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

Attribute's default value in xsd doesn't show in xslt

Subject: Attribute's default value in xsd doesn't show in xslt
From: "Eran Hammer-Lahav" <xalan@xxxxxxxxx>
Date: Wed, 28 May 2003 21:03:26 -0400
xs attribute default
Can someone please explain to me how come the default value I have set in
abc.xsd doesn't get into the abc.xslt? If I understand it correctly, I should
get a result text file of 'bbbbb' but it comes out empty. If I use abc2.xml
I get 'aaaaa' which shows the example works but not the default value.

Thanks!

EL



abc.xsd
----------------------------
<?xml version="1.0" ?>
<xs:schema id="abc" targetNamespace="abc" xmlns:omm="abc" xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="1.0">
	<xs:element name="structure">
		<xs:complexType>
			<xs:attribute name="defaultValue" type="xs:string" use="optional" default="bbbbb"
/>
		</xs:complexType>
	</xs:element>
</xs:schema>


abc.xslt
----------------------------
<xsl:stylesheet version="1.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/1999/XSL/Transform"
    xmlns:omm="abc">
    
<xsl:output method="text" />

<!-- MAIN -->

<xsl:template match="/">
	<xsl:apply-templates select="omm:structure" />
</xsl:template>

<!-- HEADER -->

<xsl:template match="omm:structure">
<xsl:value-of select="@defaultValue" />
</xsl:template>

</xsl:stylesheet>


abc.xml
----------------------------

<?xml version="1.0" encoding="utf-8" ?>
<structure xmlns="abc">
</structure>


abc2.xml
----------------------------
<?xml version="1.0" encoding="utf-8" ?>
<structure xmlns="abc" defaultValue="aaaaa">
</structure>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.