xsl-list
[Top] [All Lists]

RE: Validating xslt against a schema for the document I wan t to transform

2004-03-24 05:47:27
        Michael Kay wrote:
# I'm writing a lengthy transform for some xml data for which I 
# have a detailed xsd file. It occurs to me that as a useful, 
# quick validation to ensure that I have spelled node names 
# right and got paths correct, it would be great to be able to 
# validate my xslt against the schema for the document I want 
# to transform. This way, if I tried to follow a path that did 
# not exist or access a node name that was not permitted in the 
# document, I would get a warning message.

This is one of the aims of the integration between XSLT and XML Schema
that
comes with XSLT 2.0.

Unfortunately, despite an immensely complex type system designed to
achieve
this integration, the simple goal of spotting spelling mistakes in path
expressions isn't fully achieved, because rules in stylesheets can't be
tied
statically to specific documents. However, I would expect that XSLT 2.0
implementations will fill this gap by at least giving you warnings. 

Michael Kay

This is interesting. Assuming v2.0 is backwardly compatible, presumably I
could just run my existing transform through a suitable processor (changing
the version at the top of the XSLT script) and get the warnings I want.

I notice the latest version of Saxon implements the XSLT 2.0 specification
but you didn't suggest using it. Does it not currently integrate with Schema
in this way, or not give warnings when rules are violated?

Thanks,
Mike


The Royal Bank of Scotland plc, Registered in Scotland No. 90312. Registered 
Office: 36 St Andrew Square, Edinburgh EH2 2YB

The Royal Bank of Scotland plc is authorised and regulated by the Financial 
Services Authority and represents The Royal Bank of Scotland Marketing Group. 
The Bank sells life policies, collective investment schemes and pension 
products and advises only on the Marketing Group's range of these products and 
on a With-Profit Bond produced by Norwich Union Life (RBS) Limited.

This e-mail message is confidential and for use by the addressee only. If the 
message is received by anyone other than the addressee, please return the 
message to the sender by replying to it and then delete the message from your 
computer. Internet e-mails are not necessarily secure. The Royal Bank of 
Scotland plc does not accept responsibility for changes made to this message 
after it was sent.

Whilst all reasonable care has been taken to avoid the transmission of viruses, 
it is the responsibility of the recipient to ensure that the onward 
transmission, opening or use of this message and any attachments will not 
adversely affect its systems or data. No responsibility is accepted by The 
Royal Bank of Scotland plc in this regard and the recipient should carry out 
such virus and other checks as it considers appropriate.



<Prev in Thread] Current Thread [Next in Thread>