Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Nested XML-Schemas [Thread Next] Re: Nested XML-SchemasTo: 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 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
