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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   [xml-dev] w3c xml schema and xs:ID types

[ Lists Home | Date Index | Thread Index ]

Hi,

This question is with respect to DOM and XML Schema.

If i have elements in my w3c xml schema with attributes defined as type
xs:ID, can i then extract those elements based on that attribute (type
xs:ID) using getElementById(ID) in DOM?

e.g.

	<xs:attributeGroup name="EntryCompulsory_AG">
		<xs:attribute name="Name" type="xs:ID" use="required"/>
		<xs:attribute name="Rd" type="xs:unsignedByte"
use="required"/>
		<xs:attribute name="Wr" type="xs:unsignedByte"
use="required"/>
		<xs:attribute name="Help" type="xs:string" use="required"/>
	</xs:attributeGroup>

	<xs:element name="UnitType" type="UnitType_CT"/>
	<xs:complexType name="UnitType_CT">
		<xs:attributeGroup ref="EntryCompulsory_AG"/>
		<xs:attribute name="Min" type="xs:float" use="required"/>
		<xs:attribute name="Max" type="xs:float" use="required"/>
	</xs:complexType>

and then in my xml file i have something like:
	<UnitType Name="kg" Rd="5" Wr="5" Help="definition of kilogram unit
type"Min="0" Max="1000"/>


can i then get UnitType elements out of the DOMDocument (i.e. once the xml
file is parsed into the DOMDocument) by using:
	DOMElement *kgUnit = myDOMDocument->getElementById("kg");

thanks in advance

Paul Popiel
Software Engineer

Advanced Engine Components Limited
14 Energy St, Malaga WA 6090
Fax: +61 8 9209 6999
Mob: 0412 657 051
mailto:paulp@advancedengine.com
http://www.advancedengine.com



**********************************************************************
This email is confidential.  If you are not the intended recipient, 
you must not copy, distribute, disclose or otherwise use the 
information contained in it.   If you have received this email in 
error, please tell us immediately by return email or by contacting 
us on (+61 8) 9209 6900 and delete the document.  Email may 
be susceptible to data corruption, interception and unauthorised 
amendment.  Advanced Engine Components Ltd is not 
responsible for any changes made to a document other than 
those made by Advanced Engine Components Ltd, or for the 
effect of the changes on the document's meaning.

You must scan this email and any attachments for viruses. 
Advanced Engine Components Ltd accepts no liability for any 
loss, damage or consequence, whether caused by our own 
negligence or not, resulting directly or indirectly from your 
receipt of this email or the use of any attachments.
**********************************************************************




 

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

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