[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to check an element's type against an XSD sim
On 16 Jul 2013, at 13:29, David Carlisle wrote: > On 16/07/2013 13:07, Costello, Roger L. wrote: >> 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. > Yes, in fact you could do it at a different granularity; you could read an (unvalidated) BOOKLIST and then iterate over the BOOK elements, validating each one in turn, catching any errors using try/catch, and then doing different processing based on whether the BOOK was valid or not. Michael Kay Saxonica
|
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
|