|
[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
On 09/06/2024 17:38, Roger L Costello costello@xxxxxxxxx wrote:
> What is the right way to get a parameter validated against an XSD type?
See below (use the as attribute with the simple type name, make sure if
it is in a namespace that you declare a prefix and qualify the type name
with the prefix):
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
B version="3.0"
B xmlns:xs="http://www.w3.org/2001/XMLSchema"
B exclude-result-prefixes="#all"
B expand-text="yes">
B <xsl:import-schema>
B B <xs:schema>
B B B B <xs:simpleType name="ICAOtype">
B B B B B B B <xs:restriction base="xs:string">
B B B B B B B B B B B <xs:length value="4"/>
B B B B B B B B B B B <xs:pattern value="[A-Z]+"/>
B B B B B B B </xs:restriction>
B B B </xs:simpleType>
B B </xs:schema>
B </xsl:import-schema>
B <xsl:param name="ICAO" as="ICAOtype"/>
B <xsl:template match="/" name="xsl:initial-template">
B B B <test>{$ICAO}</test>
B </xsl:template>
</xsl:stylesheet>
|
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








