Subject: Re: [xsl] How to check an element's type against an XSD simpleType and skip that element if it does not conform to the simpleType? From: David Carlisle <davidc@xxxxxxxxx> Date: Tue, 16 Jul 2013 13:29:05 +0100 |
Michael Kay wrote:
Unfortunately schema-aware processing in XQuery and XSLT doesn't give you this capability.
Is there a workaround?
Is there is no way for an XSLT program to express: "Hey, validate xyz against the XML Schema and if xyz is not schema-valid then discard it." No way to express that?
Can't you just not validate the input, then test within the stylesheet as you are testing an atomic/simple type.
<xsl:if test=". instance of bk:ISBN-type">
If the input hasn't been validated you can just get the text content of the node and check
Or of course you could more simply in this case not import the schema and just check the regular expression directly in the stylesheet (then it will work with non schema aware systems too)
________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to check an element's, Martin Honnen | Thread | RE: [xsl] How to check an element's, Costello, Roger L. |
Re: [xsl] How to check an element's, Martin Honnen | Date | RE: [xsl] How to check an element's, Costello, Roger L. |
Month |