[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XML Schemas: Best Practices
Of course that assume that everything that wants to process <car> also knows or can fetch every schema that it can be a part of. It also makes tools like XSLT difficult to apply (you could match just the local name, but that would false match a different <car> element). Yes, if you have access to the schema, then you can determine if a particular incorporated <car> element matches your expectation, but the benefit of having the unambiguous explicit globally unique identification that explicit prefixing would provide seems to overwhelm any slight readability improvement. I would prefer to see in the XML document, for example, an explicit <xhtml:p> or <svg:group> element (with the appropriate prefix declaration) in the document, then having to check the schema to see if the <p> or <group> element in this context is identical to an <xhtml:p> or <svg:group> element or is something totally different. If I were writing the document by hand, having the processor be able to imply the namespace by dereferencing the schema might be of benefit, but is makes the job of interpreting the document more complicated both for processors and humans. p.s. You had mentioned earlier that using multiple namespaces requires you to have multiple entries in the xsi:schemaLocation attribute. I had orginally though that and it was one of my major concerns with the schema location mechanism. However, Henry Thompson pointed out that if a xsi:schemaLocation hint loads a schema the defines multiple namespaces through use of imports, then the other namespaces do not need entries in the xsi:schemaLocation. See http://lists.w3.org/Archives/Public/www-xml-schema-comments/2000JulSep/0215.html and related messages. For example, if I have an schema at http://www.example.org/schemas/auto.xsd with a target namespace of http://www.example.org/namespace/auto that imports an schema for http://www.example.org/namespace/tires, then either of these should be sufficient to locate all the necessary schema info: <tire xmlns="http://www.example.org/namespace/tires" xsi:schemaLocation="http://www.example.org/namespace/tires http://www.example.org/schemas/auto.xsd"> <mountedOn> <auto xmlns="http://www.example.org/namespace/auto"> ... </auto> </mountedOn> </tire> <auto xmlns="http://www.example.org/namespace/auto" xsi:schemaLocation="http://www.example.org/namespace/auto http://www.example.org/schemas/auto.xsd"> <standard> <tire xmlns="http://www.example.org/namespace/tires"> ... </tire> </standard> </auto>
|
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
|