OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] XSD spec question

[ Lists Home | Date Index | Thread Index ]

Chiusano Joseph wrote:
Please see comments below marked with [JMC].
 

From: Razvan MIHAIU [mailto:mihaiu@mihaiu.name]
Sent: Wed 4/27/2005 12:33 AM
To: Eric van der Vlist
Cc: xml-dev@lists.xml.org
Subject: Re: [xml-dev] XSD spec question

Eric van der Vlist wrote:
On mar, 2005-04-26 at 13:22 -0700, Chris Griffin wrote:
  
In section 3.14.2 of http://www.w3.org/TR/xmlschema-1/ it says "{any  
attributes with non-schema namespace . . . }" Does that mean I can  
add my own attributes? For example can I do this:

  <simpleType name="myName" xyz:myattribute="something">
   . . .
  </simpleType>
    
Exactly!

Eric
  
    I was not aware of this feature before. In fact, if the above is true, it is not possible to validate an XML Schema (which itself is an XML document) against a DTD because there is no way to specify in a DTD that an element can have any attributes.
 
[JMC] Why would you want to validate an XML against a DTD, when an XML schema validator will serve this purpose?
    Are you saying that a validating parser that knows XML Schema must be able to validate an XML Schema using some internal rules (like XML Spy) ? How do you write the internal validation rules for such a parser ? A quick solution would be to use "dynamic" DTDs - e.g. DTDs that are automatically generated for a given prefix (in order to overcome the lack of namespace support)

    And how about a practical problem: you transfer XML Schema between untrusted entities. How do you validate them ?


    The obvious question is why would you need attributes outside the XML Schema specification ?
 
[JMC] That's actually a rather unclear question. The XML Schema specification includes the ability to declare attributes. You declare attributes as you need, as long as your XML schema conforms to the W3C Schema specification. Sounds like you are thinking one "meta" layer too far.
 
    Maybe the XML developer has this ability just to be able to defined some innocent attributes like "xml:lang" where he sees fit, but not to declare custom attributes that will change the outcome of validation.
-- 
Regards,
Razvan

SCJP preparation material:

www.mihaiu.name/2004/sun_java_scjp_310_035/index.html
www.mihaiu.name/2004/sun_java_scjp_310_035_test1/index.html
www.mihaiu.name/2004/sun_java_scjp_310_035_test2/index.html
www.mihaiu.name/2004/sun_java_scjp_310_035_test3/index.html
www.mihaiu.name/2004/sun_java_scjp_310_035_test4/index.html




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS