Sort Question.
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 3
- Joined: Mon Nov 20, 2006 10:49 pm
Sort Question.
Hey guys,
Kind of new to this, but here goes. Below is a listing of my xml, xslt, and output. I am trying in order by @value if element has an aircraft child.
XML
<?xml version="1.0" encoding="UTF-8"?>
<vehicleCodes module="MESSENGER" name="VEHICLE_CODES" type="spclCodes" version="CPI000715">
<makes sort="n">
<generic sort="y">
<makeEdit desc="Aircraft" editEnd="" editStart="5" value="AERO">
<aircraft/>
</makeEdit>
<makeEdit desc="Aircraft" editStart="5" value="AERO Enter Make Here">
<aircraft/>
</makeEdit>
<make desc="Assembled Vehicle" value="ASVE">
<assembled/>
</make>
</generic>
<specific sort="y">
<make desc="AAA Mobile Home Mfg. Co." value="AAA">
<trailer/>
</make>
</specific>
<military sort="y">
<make desc="US Army" value="USA">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Air Force" value="USAF">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Coast Guard" value="USCG">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Marine Corps" value="USMC">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Navy" value="USN">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
</military>
<guard sort="y">
<guardMake desc="Air National Guard" value="AG">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</guardMake>
<guardMake desc="Civil Air Patrol" value="AP">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</guardMake>
<guardMake desc="National Guard" value="NG">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</guardMake>
</guard>
</makes>
</vehicleCodes>
My style sheet
<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY lf "
"><!--Linefeed-->
<!ENTITY nbsp " ">
]>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method='html' indent='no' omit-xml-declaration='yes'/>
<xsl:param name="Sort" ><xsl:value-of select="'Code'"/></xsl:param>
<xsl:template match="@*|node()">
<xsl:apply-templates>
<xsl:sort select="@value"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="vehicleCodes">
<xsl:element name="br"></xsl:element> <!-- 2 spaces before & after start of table -->
<xsl:element name="br"></xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="center">
<xsl:element name="table">
<xsl:attribute name="class">s_norm</xsl:attribute>
<xsl:attribute name="border">1</xsl:attribute>
<xsl:value-of select="'
'"/>
<xsl:element name="tr">
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:attribute name="align">center</xsl:attribute>
<xsl:element name="b">
<xsl:value-of select="'MAKE'"/>
</xsl:element><!-- end bold -->
</xsl:element> <!-- end td -->
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:attribute name="align">center</xsl:attribute>
<xsl:element name="b">
<xsl:value-of select="'VMA'"/>
</xsl:element><!-- end bold -->
</xsl:element> <!-- end td -->
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:attribute name="align">center</xsl:attribute>
<xsl:element name="b">
<xsl:value-of select="'VMO'"/>
</xsl:element><!-- end bold -->
</xsl:element>
</xsl:element> <!-- end row -->
<xsl:value-of select="'
'"/>
<xsl:choose>
<xsl:when test="$Sort='Desc' or $Sort='Code'">
<xsl:if test="$Sort='Code'"> <!--Sort table using code value -->
<xsl:apply-templates /> <!--Populate table based on match of either code or group elements from xml file -->
</xsl:if><!-- end if -->
</xsl:when><!-- end when -->
<xsl:otherwise>
<xsl:element name="tr">
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:attribute name="colspan">2</xsl:attribute>
<xsl:attribute name="align">center</xsl:attribute>
<xsl:attribute name="bgcolor">red</xsl:attribute>
<xsl:value-of select="'ERROR: the param element has an attribute of value that is UNKNOWN. Please make sure it is either Desc or Code.'"/>
</xsl:element> <!-- end td -->
<xsl:value-of select="'
'"/>
</xsl:element> <!-- end row -->
</xsl:otherwise><!-- end otherwise -->
</xsl:choose><!-- end choose -->
<xsl:value-of select="'
'"/>
</xsl:element> <!-- end TABLE -->
</xsl:element> <!-- end Center -->
<xsl:value-of select="'
'"/>
<xsl:element name="br"></xsl:element><!-- 2 spaces before & after start of table -->
<xsl:element name="br"></xsl:element>
</xsl:template><!-- end main template -->
<xsl:template match="make">
<!-- Outputs Make Heading and Descriptions for make element-->
<xsl:if test="aircraft">
<xsl:value-of select="'
'"/>
<xsl:element name="tr">
<xsl:element name="td">
<xsl:value-of select="@desc"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:value-of select="@value"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td"> </xsl:element>
</xsl:element><!-- end table row -->
<xsl:value-of select="'
'"/>
</xsl:if>
</xsl:template>
<xsl:template match="makeEdit">
<!-- Outputs Make Heading and Descriptions for makeEdit element-->
<xsl:if test="aircraft">
<xsl:value-of select="'
'"/>
<xsl:element name="tr">
<xsl:element name="td">
<xsl:value-of select="@desc"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:value-of select="@value"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td"> </xsl:element>
</xsl:element><!-- end table row -->
<xsl:value-of select="'
'"/>
</xsl:if>
</xsl:template>
<xsl:template match="guardMake">
<!-- Outputs Make Heading and Descriptions for guardMake element-->
<xsl:if test="aircraft">
<xsl:value-of select="'
'"/>
<xsl:element name="tr">
<xsl:element name="td">
<xsl:value-of select="@desc"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:value-of select="@value"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td"> </xsl:element>
</xsl:element><!-- end table row -->
<xsl:value-of select="'
'"/>
</xsl:if>
</xsl:template>
<xsl:template match="aircraft">
<!-- element has children but is not a child of models or styles -->
<xsl:if test="code and not( boolean(parent::models)) and not( boolean(parent::styles))">
<xsl:apply-templates select="*" />
</xsl:if>
<xsl:if test="not(code)">
<xsl:value-of select="'
'"/>
</xsl:if>
</xsl:template>
<xsl:template match="code">
<!-- Outputs elements which have children of type code -->
<xsl:if test="boolean(parent::aircraft)">
<xsl:element name="tr">
<xsl:element name="td"></xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:value-of select="@desc"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:value-of select="@value"/>
</xsl:element>
<xsl:value-of select="'
'"/>
</xsl:element><!-- end table row -->
</xsl:if>
</xsl:template>
</xsl:stylesheet> <!-- end stylesheet -->
and my output
<br><br>
<center><table class="s_norm" border="1">
<tr>
<td align="center"><b>MAKE</b></td>
<td align="center"><b>VMA</b></td>
<td align="center"><b>VMO</b></td></tr>
<tr><td>Aircraft</td>
<td>AERO</td>
<td></td></tr>
<tr><td>Aircraft</td>
<td>AERO Enter Make Here</td>
<td></td></tr>
<tr><td>US Army</td>
<td>USA</td>
<td></td></tr>
<tr><td>US Air Force</td>
<td>USAF</td>
<td></td></tr>
<tr><td>US Coast Guard</td>
<td>USCG</td>
<td></td></tr>
<tr><td>US Marine Corps</td>
<td>USMC</td>
<td></td></tr>
<tr><td>US Navy</td>
<td>USN</td>
<td></td></tr>
<tr><td>Air National Guard</td>
<td>AG</td>
<td></td></tr>
<tr><td>Civil Air Patrol</td>
<td>AP</td>
<td></td></tr>
<tr><td>National Guard</td>
<td>NG</td>
<td></td></tr>
</table></center>
<br><br>
Thanks for taking the time to read, just trying to get the out put to be in order by value. Should be Aero, AeroMake, AG, AP....etc as you can see i am not getting that.
Thanks again
Kind of new to this, but here goes. Below is a listing of my xml, xslt, and output. I am trying in order by @value if element has an aircraft child.
XML
<?xml version="1.0" encoding="UTF-8"?>
<vehicleCodes module="MESSENGER" name="VEHICLE_CODES" type="spclCodes" version="CPI000715">
<makes sort="n">
<generic sort="y">
<makeEdit desc="Aircraft" editEnd="" editStart="5" value="AERO">
<aircraft/>
</makeEdit>
<makeEdit desc="Aircraft" editStart="5" value="AERO Enter Make Here">
<aircraft/>
</makeEdit>
<make desc="Assembled Vehicle" value="ASVE">
<assembled/>
</make>
</generic>
<specific sort="y">
<make desc="AAA Mobile Home Mfg. Co." value="AAA">
<trailer/>
</make>
</specific>
<military sort="y">
<make desc="US Army" value="USA">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Air Force" value="USAF">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Coast Guard" value="USCG">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Marine Corps" value="USMC">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Navy" value="USN">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
</military>
<guard sort="y">
<guardMake desc="Air National Guard" value="AG">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</guardMake>
<guardMake desc="Civil Air Patrol" value="AP">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</guardMake>
<guardMake desc="National Guard" value="NG">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</guardMake>
</guard>
</makes>
</vehicleCodes>
My style sheet
<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY lf "
"><!--Linefeed-->
<!ENTITY nbsp " ">
]>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method='html' indent='no' omit-xml-declaration='yes'/>
<xsl:param name="Sort" ><xsl:value-of select="'Code'"/></xsl:param>
<xsl:template match="@*|node()">
<xsl:apply-templates>
<xsl:sort select="@value"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="vehicleCodes">
<xsl:element name="br"></xsl:element> <!-- 2 spaces before & after start of table -->
<xsl:element name="br"></xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="center">
<xsl:element name="table">
<xsl:attribute name="class">s_norm</xsl:attribute>
<xsl:attribute name="border">1</xsl:attribute>
<xsl:value-of select="'
'"/>
<xsl:element name="tr">
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:attribute name="align">center</xsl:attribute>
<xsl:element name="b">
<xsl:value-of select="'MAKE'"/>
</xsl:element><!-- end bold -->
</xsl:element> <!-- end td -->
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:attribute name="align">center</xsl:attribute>
<xsl:element name="b">
<xsl:value-of select="'VMA'"/>
</xsl:element><!-- end bold -->
</xsl:element> <!-- end td -->
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:attribute name="align">center</xsl:attribute>
<xsl:element name="b">
<xsl:value-of select="'VMO'"/>
</xsl:element><!-- end bold -->
</xsl:element>
</xsl:element> <!-- end row -->
<xsl:value-of select="'
'"/>
<xsl:choose>
<xsl:when test="$Sort='Desc' or $Sort='Code'">
<xsl:if test="$Sort='Code'"> <!--Sort table using code value -->
<xsl:apply-templates /> <!--Populate table based on match of either code or group elements from xml file -->
</xsl:if><!-- end if -->
</xsl:when><!-- end when -->
<xsl:otherwise>
<xsl:element name="tr">
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:attribute name="colspan">2</xsl:attribute>
<xsl:attribute name="align">center</xsl:attribute>
<xsl:attribute name="bgcolor">red</xsl:attribute>
<xsl:value-of select="'ERROR: the param element has an attribute of value that is UNKNOWN. Please make sure it is either Desc or Code.'"/>
</xsl:element> <!-- end td -->
<xsl:value-of select="'
'"/>
</xsl:element> <!-- end row -->
</xsl:otherwise><!-- end otherwise -->
</xsl:choose><!-- end choose -->
<xsl:value-of select="'
'"/>
</xsl:element> <!-- end TABLE -->
</xsl:element> <!-- end Center -->
<xsl:value-of select="'
'"/>
<xsl:element name="br"></xsl:element><!-- 2 spaces before & after start of table -->
<xsl:element name="br"></xsl:element>
</xsl:template><!-- end main template -->
<xsl:template match="make">
<!-- Outputs Make Heading and Descriptions for make element-->
<xsl:if test="aircraft">
<xsl:value-of select="'
'"/>
<xsl:element name="tr">
<xsl:element name="td">
<xsl:value-of select="@desc"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:value-of select="@value"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td"> </xsl:element>
</xsl:element><!-- end table row -->
<xsl:value-of select="'
'"/>
</xsl:if>
</xsl:template>
<xsl:template match="makeEdit">
<!-- Outputs Make Heading and Descriptions for makeEdit element-->
<xsl:if test="aircraft">
<xsl:value-of select="'
'"/>
<xsl:element name="tr">
<xsl:element name="td">
<xsl:value-of select="@desc"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:value-of select="@value"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td"> </xsl:element>
</xsl:element><!-- end table row -->
<xsl:value-of select="'
'"/>
</xsl:if>
</xsl:template>
<xsl:template match="guardMake">
<!-- Outputs Make Heading and Descriptions for guardMake element-->
<xsl:if test="aircraft">
<xsl:value-of select="'
'"/>
<xsl:element name="tr">
<xsl:element name="td">
<xsl:value-of select="@desc"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:value-of select="@value"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td"> </xsl:element>
</xsl:element><!-- end table row -->
<xsl:value-of select="'
'"/>
</xsl:if>
</xsl:template>
<xsl:template match="aircraft">
<!-- element has children but is not a child of models or styles -->
<xsl:if test="code and not( boolean(parent::models)) and not( boolean(parent::styles))">
<xsl:apply-templates select="*" />
</xsl:if>
<xsl:if test="not(code)">
<xsl:value-of select="'
'"/>
</xsl:if>
</xsl:template>
<xsl:template match="code">
<!-- Outputs elements which have children of type code -->
<xsl:if test="boolean(parent::aircraft)">
<xsl:element name="tr">
<xsl:element name="td"></xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:value-of select="@desc"/>
</xsl:element>
<xsl:value-of select="'
'"/>
<xsl:element name="td">
<xsl:value-of select="@value"/>
</xsl:element>
<xsl:value-of select="'
'"/>
</xsl:element><!-- end table row -->
</xsl:if>
</xsl:template>
</xsl:stylesheet> <!-- end stylesheet -->
and my output
<br><br>
<center><table class="s_norm" border="1">
<tr>
<td align="center"><b>MAKE</b></td>
<td align="center"><b>VMA</b></td>
<td align="center"><b>VMO</b></td></tr>
<tr><td>Aircraft</td>
<td>AERO</td>
<td></td></tr>
<tr><td>Aircraft</td>
<td>AERO Enter Make Here</td>
<td></td></tr>
<tr><td>US Army</td>
<td>USA</td>
<td></td></tr>
<tr><td>US Air Force</td>
<td>USAF</td>
<td></td></tr>
<tr><td>US Coast Guard</td>
<td>USCG</td>
<td></td></tr>
<tr><td>US Marine Corps</td>
<td>USMC</td>
<td></td></tr>
<tr><td>US Navy</td>
<td>USN</td>
<td></td></tr>
<tr><td>Air National Guard</td>
<td>AG</td>
<td></td></tr>
<tr><td>Civil Air Patrol</td>
<td>AP</td>
<td></td></tr>
<tr><td>National Guard</td>
<td>NG</td>
<td></td></tr>
</table></center>
<br><br>
Thanks for taking the time to read, just trying to get the out put to be in order by value. Should be Aero, AeroMake, AG, AP....etc as you can see i am not getting that.
Thanks again
-
- Posts: 3
- Joined: Mon Nov 20, 2006 10:49 pm
Trying to make this simpler I know the first post was long:
<?xml version="1.0" encoding="UTF-8"?>
<vehicleCodes module="MESSENGER" name="VEHICLE_CODES" type="spclCodes" version="CPI000715">
<makes sort="n">
<generic sort="y">
<makeEdit desc="Aircraft" editEnd="" editStart="5" value="AERO">
<aircraft/>
</makeEdit>
<makeEdit desc="Aircraft" editStart="5" value="AERO Enter Make Here">
<aircraft/>
</makeEdit>
<make desc="Assembled Vehicle" value="ASVE">
<assembled/>
</make>
</generic>
<specific sort="y">
<make desc="AAA Mobile Home Mfg. Co." value="AAA">
<trailer/>
</make>
</specific>
<military sort="y">
<make desc="US Army" value="USA">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Air Force" value="USAF">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Coast Guard" value="USCG">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Marine Corps" value="USMC">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Navy" value="USN">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
</military>
<guard sort="y">
<guardMake desc="Air National Guard" value="AG">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</guardMake>
<guardMake desc="Civil Air Patrol" value="AP">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</guardMake>
<guardMake desc="National Guard" value="NG">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</guardMake>
</guard>
</makes>
</vehicleCodes>
Here is my new style sheet:
<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY lf "
"><!--Linefeed-->
<!ENTITY nbsp " ">
]>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method='html' indent='no' omit-xml-declaration='yes'/>
<xsl:param name="Sort" ><xsl:value-of select="'Code'"/></xsl:param>
<xsl:template match="@*|node()">
<xsl:apply-templates />
<xsl:for-each select="aircraft">
<xsl:sort select="deleted" />
<xsl:value-of select="'
'"/>
<xsl:value-of select="../@value" />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet> <!-- end stylesheet -->
<?xml version="1.0" encoding="UTF-8"?>
<vehicleCodes module="MESSENGER" name="VEHICLE_CODES" type="spclCodes" version="CPI000715">
<makes sort="n">
<generic sort="y">
<makeEdit desc="Aircraft" editEnd="" editStart="5" value="AERO">
<aircraft/>
</makeEdit>
<makeEdit desc="Aircraft" editStart="5" value="AERO Enter Make Here">
<aircraft/>
</makeEdit>
<make desc="Assembled Vehicle" value="ASVE">
<assembled/>
</make>
</generic>
<specific sort="y">
<make desc="AAA Mobile Home Mfg. Co." value="AAA">
<trailer/>
</make>
</specific>
<military sort="y">
<make desc="US Army" value="USA">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Air Force" value="USAF">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Coast Guard" value="USCG">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Marine Corps" value="USMC">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
<make desc="US Navy" value="USN">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</make>
</military>
<guard sort="y">
<guardMake desc="Air National Guard" value="AG">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</guardMake>
<guardMake desc="Civil Air Patrol" value="AP">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</guardMake>
<guardMake desc="National Guard" value="NG">
<aircraft/>
<auto/>
<construction/>
<motorcycle/>
<snowmobile/>
<special/>
<trailer/>
<truck/>
</guardMake>
</guard>
</makes>
</vehicleCodes>
Here is my new style sheet:
<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY lf "
"><!--Linefeed-->
<!ENTITY nbsp " ">
]>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method='html' indent='no' omit-xml-declaration='yes'/>
<xsl:param name="Sort" ><xsl:value-of select="'Code'"/></xsl:param>
<xsl:template match="@*|node()">
<xsl:apply-templates />
<xsl:for-each select="aircraft">
<xsl:sort select="deleted" />
<xsl:value-of select="'
'"/>
<xsl:value-of select="../@value" />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet> <!-- end stylesheet -->
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service