Hello,
I've found syntax documentation on the document XSLT function, but I haven't
found a good resource yet on how to properly use it.
As stripped down example, I have XML files that are logically nested, where
the ParentID element of one is the file name of another...chaining all the
way to the top:
<!-- BasePage.xml -->
<?xml version="1.0" encoding="utf-8" ?>
<Page>
<ParentID>Parent1.xml</ParentID>
<Objects>
<ObjectID>1</ObjectID>
<ObjectID>3</ObjectID>
<ObjectID>5</ObjectID>
</Objects>
</Page>
<!-- Parent1.xml -->
<?xml version="1.0" encoding="utf-8" ?>
<Page>
<ParentID>Parent2.xml</ParentID>
<Objects>
<ObjectID>7</ObjectID>
<ObjectID>9</ObjectID>
<ObjectID>11</ObjectID>
</Objects>
</Page>
<!-- Parent2.xml -->
<?xml version="1.0" encoding="utf-8" ?>
<Page>
<ParentID>Parent3.xml</ParentID>
<Objects>
<ObjectID>13</ObjectID>
<ObjectID>15</ObjectID>
<ObjectID>17</ObjectID>
</Objects>
</Page>
<!-- Parent3.xml -->
<?xml version="1.0" encoding="utf-8" ?>
<Page>
<ParentID></ParentID> <!-- Top-level file -->
<Objects>
<ObjectID>19</ObjectID>
<ObjectID>21</ObjectID>
<ObjectID>23</ObjectID>
</Objects>
</Page>
How can I write my XSLT file so that it will:
- Start with BasePage.xml
- Render the ObjectIDs to the page, delimited by <br>
- Get the ParentID (parent XML file name)
- Print the parent XML file's ObjectIDs
- Repeat last two steps until ParentID is empty
Thank you,
Eric