473,624 Members | 2,305 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XMLSchema Parsing

km
Hi all,
i'd like to know if there are any good XMLSchema (.xsd files) parsing modules in python.
regards,
KM

Nov 27 '05 #1
3 1565
km schrieb:
Hi all,
i'd like to know if there are any good XMLSchema (.xsd files) parsing modules in python.
regards,
KM

Try lxml <http://codespeak.net/lxml/> a pythonic binding for the libxml2
and libxslt libraries.
Bye,
Dennis
Nov 29 '05 #2
Hi,

Depends entirely on what you want. I've written some XSD tools in
Python that do exactly what I want -- but don't offer support for any
XSD features that I didn't happen to need.
Module I wrote supports include/import and redefine; parses sequences,
complexTypes and simpleTypes, but not much more.

I also have some tool that generates basic XSD files from sample input
xmls, and a tool that generates sample xml files from an XSD.

I'm not aware of any Python XSD tooling but did you search google on
it?

How much of XSD do you need to be supported? And what do you need to do
with it?

cheers,

--Tim

Nov 29 '05 #3
km wrote:
i'd like to know if there are any good XMLSchema (.xsd files) parsing modules in python.
regards,


Parse and do what? You can parse WXS (a.k.a. XSD) with any XML parser
out there.

Anyway, off-head, Python tools that handle WXS, to some extent:

xsv
libxml2/Python
lxml
generateDS.py

Good luck.

--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://fourthought.com
http://copia.ogbuji.net http://4Suite.org
Articles: http://uche.ogbuji.net/tech/publications/

Nov 29 '05 #4

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

Similar topics

3
1512
by: Russell Lear | last post by:
I need to be able to unmarshall data from an XML file into (instances of) appropriate Python classes . I don't have control over the schema used. I'd like the Python classes to use lists for elements whose XMLSchema spec has maxOccurs > 1, simple attributes for maxOccurs = minOccurs = 1, dict for element attributes, etc. In the past I've just used SAX and hand-written the parsing - a straightforward, fairly mechanical task. In short,...
0
1772
by: BODIN | last post by:
I have an XML document, which is actually physically stored in 2 separated files. doc1.xml and doc2.xml I NEED a WAY FOR THIS SIMPLE NEED : XML file splitted into two physical files, and use of XML Schema.
2
9072
by: AlexS | last post by:
Hello, I have error when reading schema using XmlSchema. Read and then .Compile: System.Xml.Schema.XmlSchemaException: May not be nominated as the {substitution group affiliation} of any other declaration. An error occurred at , (11, 3). Schema compile error: System.Exception: Schema error ---> System.Xml.Schema.XmlSchemaException: May no
4
7116
by: Stefan Rotter | last post by:
Hi, I'm trying to load a schema into an XmlSchema object with the Read and Compile methods. I use Read with a ValidationEventHandler. No errors occurs but when I look at the XmlSchema properties it contains NOTHING. The schema file is correct because I can use it to validate xmldocuments with the XMLValidatingReader. What am I doing wrong here? Code:
2
1893
by: Alex Shirshov | last post by:
Hello, All! It seems the bug (http://groups.google.com/groups?hl=ru&lr=&ie=UTF-8&threadm=a53b01c28a00%242 08bc860%2439ef2ecf%40TKMSFTNGXA08&rnum=8&prev=/groups%3Fq%3DschemaLocation%2 BXmlSchema%2B.NET%26hl%3Dru%26lr%3D%26ie%3DUTF-8%26selm%3Da53b01c28a00%25242 08bc860%252439ef2ecf%2540TKMSFTNGXA08%26rnum%3D8) wasn't fixed neither in v1.1 nor in v2.0. Here is exception
1
1390
by: qdm | last post by:
Below is a snippet that I'm sure is quite familiar to most ... <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" Here, I've given the XMLSchema namespace the prefix 'xsd', and with that, I can reference datatypes within the XMLSchema namespace ... i.e., xsd:string. That's great, but why can't I use that same notation, to reference dataypes in a homegrown schema ... WITHOUT doing an <import> or
1
1527
by: Rumen Traykov via .NET 247 | last post by:
Have somebody had already the problem of having to write more than one XmlSchema, where some of these schemas have imports to others and respectively derived types? The imports cannot be resolved until I dont save all schemas to disk, but I cannot do this because I get an error for the derived types(which have base types from schema which is not written yet, so the import cannot be resolved). How could I solve this problem? I dont need any...
4
1414
by: Geir Aamodt | last post by:
I have an xml schema and an xml file. When parsing the xml file I would like to perform operations on elements marked in the schema with the "search:able" attribute. See sample files below. Any tips/tricks on how to achieve this? ----------------------XML Schema sample---------------------- <?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"...
1
4020
by: Ryan | last post by:
Hello Xml Gurus, I'm trying to build an XML schema in memory using the System.Xml.XmlSchema namespace objects, validate it, and then write it to a file. The problem I'm facing is that XmlSchema.Write() is changing <xsd:element minOccurs="1" name="AccountId" type="s-xsd:primarykey" /> to be
0
8238
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8336
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8478
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7164
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1485
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.