I have a web to print solution that provides me with an XML file with every job ticket. When the job tickets were created, some questions are universal across order forms, items such as "job name", "due date", "quantity", "is a proof required", etc. The problem is that they are not always in the same order on each form's XML file. In my example, I have an XML file for my posters order form and an XML file from my flyers order form. I'm looking for the saved value for udf_Proof:
<JobItemField>
<ID>udf_Proof</ID>
<Type>D</Type>
<Prompt>Proof Requested?</Prompt>
<Value>None Printed Proof Online Proof</Value>
SavedValue>Printed Proof</SavedValue>
In the order form for posters, the XML location path according to switch is:
/Job/Items/JobItem/Fields/JobItemField[79]
In the order for flyers, the XML location path accodring to switch is:
/Job/Items/JobItem/Fields/JobItemField[105]
In other order forms it's a different number. My question is, can you have switch look for the key word <ID>udf_Proof</ID> and identify the saved value, rather than just looking for the specific JobItemField[XX] ? I've attached a couple of screen shots showing the location path from switch as well as the XML files
Grab the correct field in XML file
-
- Newbie
- Posts: 2
- Joined: Mon Nov 11, 2024 5:32 pm
Grab the correct field in XML file
- Attachments
-
- XML Files.zip
- (14.95 KiB) Downloaded 752 times
-
- Screenshot 7944289 (Flyer Order Form).jpg (133.89 KiB) Viewed 6033 times
-
- Screenshot 7943029 (Poster Order Form).jpg (134.38 KiB) Viewed 6033 times
Re: Grab the correct field in XML file
In the XPath you write /JobItemField[ID='udf_Proof']/Value
Then it can be in any order since we now refer to the ID=udf_Proof
Then it can be in any order since we now refer to the ID=udf_Proof
- magnussandstrom
- Advanced member
- Posts: 510
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: Grab the correct field in XML file
I guess that you will need an extra forward slash in the beginning of the XPath: //JobItemField[ID='udf_Proof']/Value
Re: Grab the correct field in XML file
I just ment the last part of the Xpath, but yes a double slash excludes the common part before that.magnussandstrom wrote: ↑Tue Nov 12, 2024 10:03 pmI guess that you will need an extra forward slash in the beginning of the XPath: //JobItemField[ID='udf_Proof']/Value