XML File Nodes and Attributes

Posted by: mikenorris21 on 4 August 2017, 2:34 pm EST

  • Posted 4 August 2017, 2:34 pm EST

    I am trying to process through the attached XML file, but am having a problem when I get to the point of processing the Order Details section...all of the other data will process fine.

     
       Valaue of sometext0
       Valaue of sometext1   
       Valaue of sometext2
       Valaue of sometext3
       Valaue of sometext4


    If anyone knows how to process through this portion of the XML file i would greatly appreciate your help.  Thanks


    THE XML FILE CONTENTS****************


      xml version="1.0" encoding="UTF-8" ?>
    - < companyName   xmlns =" http://www.companyName.com " >
    - < AdviseOfOrder >
      < OrderNumber > 00000061 OrderNumber >
      < OrderDate > 03/30/05 OrderDate >
      < PurchaseOrderNumber > 202301-MT PurchaseOrderNumber >
    - < Shipping >
      < ShippingMethod > UPS Ground ShippingMethod >
    - < Address >
      < Company > Maverick test Company >
      < FirstName > Mark FirstName >
      < LastName > Trumper LastName >
      < Address1 > 965 East Midlothian BLVD Address1 >
      < Address2 > 4th Floor Address2 >
      < City > edmonds City >
      < State > WA State >
      < Zipcode > 98020 Zipcode >
      < Country > United States Country >
      < PhoneDay > 425-771-6500 PhoneDay >
      < PhoneNight > 425-771-6500 PhoneNight >
      < Fax > 425-771-6500 Fax >
      < Email > MarkTrumper@MaverickLabel.Com Email >
      Address >
      Shipping >
      < ShippingCost > 6.49 ShippingCost >
    - < LineItem >
      < JobNumber > PS050-890-009 JobNumber >
      < Quantity > 1000 Quantity >
    - < AttributeList >
      < Attribute id =" Core Size " > 3" Attribute >
      < Attribute id =" Usage " > Indoor Use Attribute >
      < Attribute id =" Material " > Flexible Clear Film Attribute >
      < Attribute id =" Shape " > Rectangle Attribute >
      < Attribute id =" Size " > 1 1/2" x 3/4" Attribute >
      < Attribute id =" Barcode " > None Attribute >
      < Attribute id =" Proofs " > true Attribute >
      < Attribute id =" Roll Unwind Direction " > #4 Attribute >
      < Attribute id =" Color " > Black Attribute >
      < Attribute id =" Color " > Warm Red Attribute >
      < Attribute id =" Custom Color " > 206 Attribute >
      < Attribute id =" Customer Part Number " > test Attribute >
      < Attribute id =" Label Description " > test XML Attribute >
      < Attribute id =" Special Instructions " > testing new XML feature Attribute >
      AttributeList >
      < Expedite > Standard Expedite >
      < ScheduledShipDate > 04/05/05 ScheduledShipDate >
      < ScheduledDeliveryDate > 04/11/05 ScheduledDeliveryDate >
      < PackingList > 1 PackingList >
      LineItem >
      AdviseOfOrder >
        companyName >
  • Replied 4 August 2017, 2:34 pm EST

    Could you be a bit more specific as to what doesn't work? Also, posting the report in question would help me determine what's happening. Could you zip either the RPX or the dsr & dsx files for this report and attach them to your response? Thanks!
  • Replied 4 August 2017, 2:34 pm EST

    Hi Brandon,

    I was having trouble bringing the elements value and its corresponding attribute id="somedata" in pattern by patteren. 

    I have contacted the company that emails this file out to us and had them re-write the XML file to say this.


       DataValue1
       DataValue2
       DataValue3
       DataValue4
       DataValue5
       DataValue6


    The attribute "id" corresponds to a database field and attribute "value" corresponds to its data that is inserted to the database.

    This way i can step through RecordPattern in a Loop statement and get this information to add to a database.

    I think I have it figured out...If it dosen't work I will attach the report i am having trouble with.

    thanks

    Mike Norris

  • Replied 4 August 2017, 2:34 pm EST

    Hi Brandon...here is the DSR file and the XML file...let me know what you see.

    I am trying to get the records out of the XML file and in to a SQL Server Database.

    Thanks

    Mike
    2005/04/Process XML File.zip
  • Replied 4 August 2017, 2:34 pm EST

    Hi Mike,

    You'll need to setup each datafield to reflect the correct RecordsetPattern for each attribute. For example, I used "LineItem/AttributeList/Attribute/@id" to return the attribute @id in the AttributeList. If the number of attributes changes, you'll need to add a dynamic subreport that adds controls in its ReportStart event based on your input from the Attribute list.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels