473,395 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Parsing XML Schema's

Hello -

I am trying to parse a .XSD file to obtain information about element
name and type in the file. I have been trying to find some kind of
documentation for Schema Parsing. All I come across is documentation
for validating XML files against XSD files. Is ther any way to parse
the XSD file itself? Any help will be appreciated.

Thanks for your time.

Regards,
-Pushya
Jul 20 '05 #1
4 7214


Pushya wrote:
I am trying to parse a .XSD file to obtain information about element
name and type in the file. I have been trying to find some kind of
documentation for Schema Parsing. All I come across is documentation
for validating XML files against XSD files. Is ther any way to parse
the XSD file itself? Any help will be appreciated.


MSXML and MS .NET implement a schema object model I think, check
http://msdn.microsoft.com/library/de...rview_73g7.asp
http://msdn.microsoft.com/library/de...rence_3ig5.asp

I think Xerces from xml.apache.org also implements some grammar (schema)
object model.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
Ray
Hi Martin,

do you mean the xmlbeans by apache.org or any other (java) xml binding
frameworks? I'm looking for the same facility
in order to manipulate a dom tree, e.g. adding child nodes to a node
with the rigth types, so that the xml or dom stays valid.

It would be the best if there exists methods that there are methods
handling this by themselves. For example: If a valid xml looks like:

<book>
<title>XML in a Nutshell</title>
<author>Author's Name</title>
<publisher></publisher>
<price>39.99</price>
</book>

and assuming the publisher title does not exist yet. Now I would
like to add the publisher tag including content to the dom tree or
xml.
This should be done by the add method, knowing that it has to add the
tag between author and price. Ok, in this
example the order is not relevant, but in other cases it is and the
right order and should be preserved according
to the schema.

Are they any tools or frameworks (preferable to use with java), that
can handle this. I think it would be possible with
java xml binding frameworks like castor or jaxb but at the moment i
would prefer to access directly the dom.

Thanks!

Regards
Ray
Martin Honnen <ma*******@yahoo.de> wrote in message news:<40********@olaf.komtel.net>...
Pushya wrote:
I am trying to parse a .XSD file to obtain information about element
name and type in the file. I have been trying to find some kind of
documentation for Schema Parsing. All I come across is documentation
for validating XML files against XSD files. Is ther any way to parse
the XSD file itself? Any help will be appreciated.


MSXML and MS .NET implement a schema object model I think, check
http://msdn.microsoft.com/library/de...rview_73g7.asp
http://msdn.microsoft.com/library/de...rence_3ig5.asp

I think Xerces from xml.apache.org also implements some grammar (schema)
object model.

Jul 20 '05 #3


Ray wrote:

do you mean the xmlbeans by apache.org or any other (java) xml binding
frameworks? I'm looking for the same facility
in order to manipulate a dom tree, e.g. adding child nodes to a node
with the rigth types, so that the xml or dom stays valid.

It would be the best if there exists methods that there are methods
handling this by themselves. For example: If a valid xml looks like:

<book>
<title>XML in a Nutshell</title>
<author>Author's Name</title>
<publisher></publisher>
<price>39.99</price>
</book>

and assuming the publisher title does not exist yet. Now I would
like to add the publisher tag including content to the dom tree or
xml.
This should be done by the add method, knowing that it has to add the
tag between author and price. Ok, in this
example the order is not relevant, but in other cases it is and the
right order and should be preserved according
to the schema.

Are they any tools or frameworks (preferable to use with java), that
can handle this. I think it would be possible with
java xml binding frameworks like castor or jaxb but at the moment i
would prefer to access directly the dom.


DOM Level 3 validation has methods to help you edit a document compliant
to a schema. I am not sure when/whether Xerces intends to support that.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #4
fi********@hotmail.com (Pushya) writes:
I am trying to parse a .XSD file to obtain information about element
name and type in the file. I have been trying to find some kind of
documentation for Schema Parsing. All I come across is documentation
for validating XML files against XSD files. Is ther any way to parse
the XSD file itself? Any help will be appreciated.


If you're a Python user, XSV [1] exposes its schema data model.

ht

[1] http://www.ltg.ed.ac.uk/~ht/xsv-status.html
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ewan B | last post by:
Hi, I'm using Xerces to parse XML files using SAX2, and am wondering if there is any information as to what exceptions are being thrown when certain validation errors occur. Taking a simple...
2
by: Christophe Vanfleteren | last post by:
Hello, I'm parsing xml that is returned by the Amazon webservices (using their REST interface). Their dev-heavy.xsd has the following entry: <xs:element name="Track"> <xs:complexType>...
2
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home...
0
by: Pentti | last post by:
Can anyone help to understand why re-parsing occurs on a remote database (using database links), even though we are using a prepared statement on the local database: Scenario: ======== We...
2
by: Mike | last post by:
Hi! I have an Excel 2003 Schema I need to parse to extract elements names. I am puzzled which System.Xml object can help me. Here's the example of my schema: I need to get a collection of...
8
by: pradeepsarathy | last post by:
Hi all, Does the SAX parser has eventhandlers for parsing xml schema. Can we parse the xml schema the same way as we parse the xml document using SAX Parser. Thanks in advance. -pradeep
1
by: christian.eickhoff | last post by:
Hi, I have a general question regarding the parsing of XSD files, referenced within the namespace using Apache Xerces 2.7.0 (CDT). My current c++ application can parse and validate an XML file...
1
by: padmagvs | last post by:
I am working on some code which parses wsdl . I have a complex wsdl which is failing to parse . I have to modify this wsdl for parsing . wanted to know the complex wsdl i am using is as per...
1
by: JJadhav | last post by:
I have written the following schema file: <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.abc.com/DDSchema" targetNamespace="http://www.abc.com/DDSchema"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.