searching xsd for certain types

V

vissuyk

Hi,

I am new to xsd, any help is greatly appreciated. I will have
customers define xsd. In there they will designate an attribute to be
of certian type (e.g some:transid). When I see this in the xsd I have
to create that attribute (if not already exists) and assign transaction
id.

XSD look something like :
-------------------------------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:some="http://xmlns.something.com/something"
elementFormDefault="qualified">
<xs:element name="Item" >
<xs:complexType>
..
<xs:attribute name="transaction_id" type="some:transid"
use="required"/>
</xs:complexType>
</xs:element>
...
</xs:schema>

customer defined xml looks like:
-----------------------------------------------

<Item name="whatever name">
.....
</Item>

I add this attribute

<Item name="whatever name" transaction_id="12345678">
.....
</Item>

This is a made up example, but convey the point. The problem is I dont
know how to search xsd for attributes of type some:transid. I can have
them set type="some:transid". Customers can declare this at root node
or any sub node. I can parse the DOM tree figuring out each attribute
value of every node to see if there is a type=some:transid. But this
will kill me when the document is large. I am assuming there is a
better way to search xsd for attributes/element of certain type. Any
better ways to do this ?.

Thanks,

Vissu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top