Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Nested XML-Schemas

From: "Günter Prossliner" <g.prossliner/gmx/at>
To: NULL
Date: 4/1/2007 5:07:00 PM

Hi Joe!

> Did you add both of your schemas to Visual Studios schema cache, a
> special folder?

Of cause I did. Otherwise I wouldn't get validation at all.

> You may also need to import one schema into another so that you can
> take advantage of the two namespaces.

The Schema-File do not know each other, but the XML-Document includes both.

Just take the Example of XSLT (in fact, the Schema I am developing is much 
like XSLT):

You use XSLT to create output XML with a Schema. It is not possible to 
reference the Schemas of any XML that will be generated by XSLT (this is 
where the xsl:any takes place). On the other hand - allthough it would be 
theoretical possible - it would also be not prakticable to design the Schema 
of the XML that will be generated special, just for the case that it will be 
generated by XSLT.


The example from my first posting points this out:

>> <xsl:stylesheet version="2.0"
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>> xmlns:out="urn:sample"
>>>
>>
>>  <xsl:template match="/">
>>    <out:root>
>>      <out:el1>
>>      <xsl:element name="el2" />
>>      </out:el1>
>>    </out:root>
>>  </xsl:template>
>>
>> </xsl:stylesheet>

Allthough "xsl:element" is not defined within the Schema "urn:sample", 
VS.Net validates this correctly.

When I do exactly the same with my Schema, I get the Validation Error. Even 
if I take the XSLT - Schema that VS.Net uses (taken from the {PF}\Visual 
Studio\XML\Schema directory), just changing the Namespace from 
"http://www.w3.org/1999/XSL/Transform" to e.g. "urn:test", and changing the 
XML to

>> <xsl:stylesheet version="2.0"
>> xmlns:xsl="urn:test"
>> xmlns:out="urn:sample"
>>>
>>
>>  <xsl:template match="/">
>>    <out:root>
>>      <out:el1>
>>      <xsl:element name="el2" />
>>      </out:el1>
>>    </out:root>
>>  </xsl:template>
>>
>> </xsl:stylesheet>

I get a Validation Error saying "'element' from 'urn:test'" is no valid 
child-element of 'el1' from 'urn:sample'".

This makes me think, that XSLT is threaded somehow special in VS.Net (or in 
XML at all?) to avoid that any XML that is generated with XSLT cannot be 
validated.

So: Is there any chance to register my Schema within VS.Net that the same - 
XST like - validation-behavior?



br
GP 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent