|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Is there any benefit to creating a variable and s
Martin wrote:
------------------------------
In schema-aware XSLT 2 or later I think you might be able to import a
schema that defines a type with some restrictions so that some of your
constraints are ensured and use that type in the "as" attribute.
------------------------------
That sounds like an excellent approach Martin. So, I created an XSD with this
type definition:
<xs:simpleType name="ICAOtype">
<xs:restriction base="xs:string">
<xs:length value="4"/>
<xs:pattern value="[A-Z]+"/>
</xs:restriction>
</xs:simpleType>
In my XSLT program I imported the XSD:
<xsl:import-schema schema-location="ICAO.xsd"/>
For the param, I figured that I could add xsl:type, like this:
<xsl:param name="ICAO" xsl:type="ICAOtype"/>
But that results in this error message:
Attribute @xsl:type is not allowed on element <xsl:param>
Removing "xsl:" results in a similar error message:
<xsl:param name="ICAO" type="ICAOtype"/>
What is the right way to get a parameter validated against an XSD type?
/Roger
|
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
|

Cart








