Rank: Newbie
Joined: 11/27/2016 Posts: 3
|
I'm using XMLSpy 2016 to generate a collection.xml file where the source files (WCAG2 xml) are in subdirectories.
Can't get the two xpath expressions right.
Here's the structure ...
Code:techniques aria.xml css.xml
aria ARIA1.xml fyi: <technique id="ARIA1">..</technique> ARIA2.xml css CSS1.xml CSS2.xml
In case it helps ...
the main directory contains files named after the subdirectories and each file's root element contains the file name as its @id.
Desired output:
Code:<collection> <doc href="aria/ARIA1.xml"/> <doc href="aria/ARIA2.xml"/> <doc href="css/CSS1.xml"/> <doc href="css/CSS2.xml"/> </collection>
My busted XSLT uses //*.xml in the collection expression, which is a guess, and my doc expression only works for these files when they're in the same directory, not spread across a dozen.
Code:<xsl:variable name="files" select="collection('D:/data/main//*.xml')"/>
<collection> <xsl:for-each select="$files"> <doc href="{concat('main/',./element()[1]/@id,'.xml')}"/> </xsl:for-each> </collection>
Thanks!
|
Rank: Newbie
Joined: 11/27/2016 Posts: 3
|
The solution had been on xmlplease.com, but it's still available on the web archive:
http://web.archive.org/web/20170424174247/http://www.xmlplease.com:80/collection
|