Searching for link in XML/JDF file [SOLVED]
Posted: Thu Feb 16, 2023 5:33 pm
I've got an xml with multiple entries for file links. The list could include one entry or up to ten, and the target won't be always in the same position. I need to use the link that's name ends in "-all.pdf" to download my file. I am trying to store the url as a Private Data Key. All the values are either the same (<type>, <units>) or unique to the order (<name>,<url>, <checksum>, etc.).
I know how to filter when searching for a specific value (/MxJdf4/job/article/additional-files/additionalFiles[sizeInBytes=3385008]/url).
Is there a way in the Metadata > Build Location Path to search for a partial file name (/url=%-all.pdf)?
Here is a sample list of URL's. In this example I'm trying to get "<url>https://url1.com/job966098-3-all.pdf</url>":
<additional-files>
<additionalFiles>
<type>0</type>
<name>job966098-3.pdf</name>
<url>https://url1.com/job966098-3.pdf</url>
<checksum>eaca23fdfa58ba359dfd0d59c1bdbc13</checksum>
<sizeInBytes>6104367</sizeInBytes>
<trimBox>
<longEdge>228.60000610351562</longEdge>
<shortEdge>152.39999389648438</shortEdge>
<units>1</units>
</trimBox>
</additionalFiles>
<additionalFiles>
<type>0</type>
<name>job966098-3-cover.pdf</name>
<url>https://url1.com/job966098-3-cover.pdf</url>
<checksum>fe56552eb9243cb32001c89c4db7f785</checksum>
<sizeInBytes>236682</sizeInBytes>
<trimBox>
<longEdge>304.79998779296875</longEdge>
<shortEdge>228.60000610351562</shortEdge>
<units>1</units>
</trimBox>
</additionalFiles>
<additionalFiles>
<type>0</type>
<name>job966098-3-all.pdf</name>
<url>https://url1.com/job966098-3-all.pdf</url>
<checksum>593bf192b7fd985b69d116768e588f10</checksum>
<sizeInBytes>5714732</sizeInBytes>
<trimBox>
<longEdge>304.79998779296875</longEdge>
<shortEdge>228.60000610351562</shortEdge>
<units>1</units>
</trimBox>
</additionalFiles>
</additional-files>
I know how to filter when searching for a specific value (/MxJdf4/job/article/additional-files/additionalFiles[sizeInBytes=3385008]/url).
Is there a way in the Metadata > Build Location Path to search for a partial file name (/url=%-all.pdf)?
Here is a sample list of URL's. In this example I'm trying to get "<url>https://url1.com/job966098-3-all.pdf</url>":
<additional-files>
<additionalFiles>
<type>0</type>
<name>job966098-3.pdf</name>
<url>https://url1.com/job966098-3.pdf</url>
<checksum>eaca23fdfa58ba359dfd0d59c1bdbc13</checksum>
<sizeInBytes>6104367</sizeInBytes>
<trimBox>
<longEdge>228.60000610351562</longEdge>
<shortEdge>152.39999389648438</shortEdge>
<units>1</units>
</trimBox>
</additionalFiles>
<additionalFiles>
<type>0</type>
<name>job966098-3-cover.pdf</name>
<url>https://url1.com/job966098-3-cover.pdf</url>
<checksum>fe56552eb9243cb32001c89c4db7f785</checksum>
<sizeInBytes>236682</sizeInBytes>
<trimBox>
<longEdge>304.79998779296875</longEdge>
<shortEdge>228.60000610351562</shortEdge>
<units>1</units>
</trimBox>
</additionalFiles>
<additionalFiles>
<type>0</type>
<name>job966098-3-all.pdf</name>
<url>https://url1.com/job966098-3-all.pdf</url>
<checksum>593bf192b7fd985b69d116768e588f10</checksum>
<sizeInBytes>5714732</sizeInBytes>
<trimBox>
<longEdge>304.79998779296875</longEdge>
<shortEdge>228.60000610351562</shortEdge>
<units>1</units>
</trimBox>
</additionalFiles>
</additional-files>