[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Making a lookup structure from multiple documents
Thanks to Martin, I have a stylesheet that collects the data I need. I am using elements instead of a map. It works well on a single topic, but it doesnbt collect anything when I run it on a parent map that references the topics. I am not sure what I am missing. Here is my stylesheet: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:math="http://www.w3.org/2005/xpath-functions/math" xmlns:map="http://www.w3.org/2005/xpath-functions/map" exclude-result-prefixes="xs math map" version="3.0" expand-text="yes"> <xsl:output indent="yes"/> <xsl:accumulator name="summary-data" initial-value="()" as="element()*"> <xsl:accumulator-rule match="tool" select="$value, ." /> <xsl:accumulator-rule match="spare" select="$value, ." /> <xsl:accumulator-rule match="supply" select="$value, ." /> </xsl:accumulator> <xsl:template match="@href[matches(.,'(dita(map)?|xml)$','i')=true()]"> <xsl:if test="doc-available(.)=true()"> <xsl:message>{.}</xsl:message> <xsl:apply-templates select="doc(.)/*"/> </xsl:if> </xsl:template> <xsl:template match="/"> <xsl:apply-templates/> <xsl:for-each select="accumulator-after('summary-data')"> <xsl:element name="{local-name(.)}">{.}</xsl:element> </xsl:for-each> </xsl:template> <xsl:mode on-no-match="shallow-skip" use-accumulators="summary-data"/> </xsl:stylesheet> Here are two topics: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> <task id="task_j2c_k5w_txb_1"> <title>Task 1</title> <taskbody> <steps> <step> <stepreq> <tools> <tool quantity="1">Tool1</tool> </tools> <spares> <spare quantity="1">Spare1</spare> <spare quantity="3">Spare2</spare> <spare quantity="1">Spare3</spare> </spares> <supplies id="supplies_obp_y4s_sxb"> <supply quantity="1">Supply1</supply> </supplies> </stepreq> <cmd>Do this</cmd> </step> </steps> </taskbody> </task> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> <task id="task_j2c_k5w_txb_2"> <title>Task 2</title> <taskbody> <steps> <step> <stepreq> <tools> <tool quantity="1">Tool1</tool> </tools> <spares> <spare quantity="1">Spare1</spare> <spare quantity="3">Spare2</spare> <spare quantity="1">Spare3</spare> </spares> <supplies id="supplies_obp_y4s_sxb"> <supply quantity="1">Supply1</supply> </supplies> </stepreq> <cmd>Do that</cmd> </step> </steps> </taskbody> </task> Here is the ditamap that references the 2 topics: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA 1.3 Map//EN" "technicalContent/dtd/map.dtd"> <map id="example_summary_plugin" xml:lang="nl-BE"> <title>Example summary plugin</title> <topicref href="_Test1.dita" keys="M7" format="dita" type="topic"/> <topicref href="_Test2.dita" keys="M7" format="dita" type="topic"/> </map> Basically, I want to collect all of the data from all referenced topics so I can use it later in my processing. Thank you! Rick
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|