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

Re: Attribute's default value in xsd doesn't show in x

Subject: Re: Attribute's default value in xsd doesn't show in xslt
From: "Eran Hammer-Lahav" <xalan@xxxxxxxxx>
Date: Thu, 29 May 2003 10:11:38 -0400
xsd attribute default
I have replaced my abc.xml with the code you provided and it still doesn't
recognize the default value from the abc.xsd. Also, you wrote 'xsi:schemaLocation="abc
abc.xsd"', what is the syntax of "abc abc.xsd"?

Here are my three files again:

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="xcs"
/>
		</xs:complexType>
	</xs:element>
</xs:schema>


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

<?xml version="1.0" encoding="utf-8" ?>
<structure xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="abc
abc.xsd" xmlns="abc">
</structure>


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" />

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

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

</xsl:stylesheet>





>-- Original Message --
>Date: Thu, 29 May 2003 16:56:46 +0200
>From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>Subject: Re:  Attribute's default value in xsd doesn't show in xslt
>Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>
>
>Eran Hammer-Lahav wrote:
>
>> Thanks for your quick reply. Can you tell my how I can modify my code
to
>> turn validation on? I am using xalan from the command line, not through
>> the Java API.
>
>Xalan's command line does validate by default, but usually if you want
to
>
>validate you have to specify schema document, so try this:
>
><structure xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>xsi:schemaLocation="abc abc.xsd" xmlns="abc"></structure>
>
>-- 
>Oleg Tkachenko
>http://www.tkachenko.com/blog
>Multiconn Technologies, Israel
>
>
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>



 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.