[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSL newbie help needed

Subject: XSL newbie help needed
From: "Ashley Mort" <Ashley_C_Mort@xxxxxxxxxxxx>
Date: Thu, 16 Sep 2004 09:35:07 -0400
ashley mort
Below is an .xsd document.  I want to display all @type that is a model
of a car.  For example I want the output to be:

Ford Focus Mustang F150 Taurus
 
<xsd:schema>
<xsd:element name="ford" type="Ford" substitutionGroup="car"/>
<xsd:element name="focus" type="Focus" substitutionGroup="ford"/>
<xsd:element name="mustang" type="Mustang" substitutionGroup="ford"/>
<xsd:element name="f150" type="F150" substitutionGroup="ford"/>
<xsd:element name="taurus" type="Taurus" substitutionGroup="ford"/>
<xsd:element name="firestone" type="Firestone"
substitutionGroup="tires"/>
<xsd:schema>
  
 
Here is an XSL stylesheet that does what I want but I need the 2nd "if"
to be a variable that is the NAME where substitutionGroup="car".  It
can't be hard coded because I need the same XSL to transform additional
XSDs.
 
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:mdc="http://us.mil.dcgs/metadata"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsl:template match="/">
<xsl:for-each select="descendant::xsd:element">
<xsl:if test="contains(@substitutionGroup,'car')">
<xsl:value-of select="@type"/><xsl:text> </xsl:text>
</xsl:if>
<xsl:if test="contains(@substitutionGroup,'ford')">     <!-- ford should
not be hard coded -->
<xsl:value-of select="@substitutionGroup"/>-<xsl:value-of
select="@type"/> <xsl:text> </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


------------------------------------
Raytheon
Ashley Mort
Software Engineer 1
Ashley_C_Mort@xxxxxxxxxxxx
300 Science Park Rd
State College, PA 16803
tel: 814 278 3920
------------------------------------



--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
--+--

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.