473,466 Members | 1,412 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Schema definition for a generic XML structure

Ben
Due to my unfamiliarity with schemas, I am unable to figure out how to
accomplish the same type of processing that I have currently working
under a dtd. We have a pre-defined generic message header that must
appear on all XML messages in our shop. We have several processes
that just need to process the generic header to determine how to route
the message and which service needs to process the message. So we
have an XML structure that at a high level looks like this:

<Message>
<MessageHeader appID="" action=""></MessageHeader>
<MessageBody></MessageBody>
</Message>

The MessageBody gets redefined with application specific data. The
generic process does not need to know about the contents of the
MessageBody. The specific application reparses the message,
validating the contents and getting at its information. This a
relatively straight forward process but for the life of me I can't
seem figure out how to define this relationship properly in a schema.
With my current level of schema knowledge and using the above XML
example I would think I would start with the following as a base:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Message">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="MessageHeader"/>
<xsd:element ref="MessageBody"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="MessageBody">
<xsd:complexType/>
</xsd:element>
<xsd:element name="MessageHeader">
<xsd:complexType>
<xsd:attribute name="action" type="xsd:string" use="optional"/>
<xsd:attribute name="appID" type="xsd:string" use="optional"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>

1) Is how I am defining this base schema (schema #1) wrong?
2) If I define this generic structure(schema #1) as my base, how do a
change this base to flesh out the MessageBody in another schema
(schema #2)? NOTE: I would still need to be able to parse/validate the
resulting XML defined by schema#2 using the schema #1 definition.

Thanks,
Ben
Jul 20 '05 #1
1 3842
be*******@hotmail.com (Ben) writes:
Due to my unfamiliarity with schemas, I am unable to figure out how to
accomplish the same type of processing that I have currently working
under a dtd.


Can you show us the part of the DTD that makes it work. I would
be surprised if there is anything much you can do with XML DTDs
that you cannot do with XML Schema documents (or Relax NG, or
most other languages for XML schemas). [There are, to be sure,
some parameter-entity tricks which cannot be replicated using
XML Schema constructs -- but if you really find your back to the wall,
you can always replicate those parameter-entity tricks
using general entities.]

-C. M. Sperberg-McQueen
World Wide Web Consortium
Jul 20 '05 #2

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

Similar topics

1
by: ruthless | last post by:
hello. i've got a question can i in XML Schema define tag that works as lists knows from e.g. C,C++ - recurrent tags? i'm talking about e.g. genealogical tree every level of this tree is...
3
by: Sony Antony | last post by:
Hello: ( Please redirect me to the correct list if this is not where I m supposed to ask this question ) Our application essentially sends xml 'commands' to another system. These commands...
2
by: Victor Engmark | last post by:
I am making an XML Schema for emails, and would like to specify that any elements from the XHTML2 namespace are allowed in the body/contents and signature/footer parts of the message (and _only_...
0
by: Sebasti?n Streiger | last post by:
Hi everybody! I´m new to XML and I need to generate an XML document. I should suppport the outpus from an SQL query that may be user defined. So I need to export that data to an XML document and...
0
by: Zbyszek Cybulski | last post by:
Hello, I was trying to find anything on the topic in the archives but failed. This may seem a well-known issue but I am a newbie on XML stuff. I have created an XML Schema file (XSD) which...
3
by: AtariPete | last post by:
Hey all, I want to return an xml structure without .net trying to inject any of its xml schema? Can this be done? Here is the scenario: I'm running into an issue with the return string of my...
3
by: Sathyaish | last post by:
Thingies: - Report Definition Language (RDL) - Resource Definition Framework (RDF) - Web Service Definition Language (WSDL) - C# Application Markup Language (CSAML) - Extensible Application...
1
by: jman | last post by:
Is there anyway to write a VERY generic schema for the xml recieved when you serialize a DataSet? I know that the serialization includes a copy of the specific schema used by the dataset. I will...
0
by: mk189 | last post by:
Hi, I am trying to create XML schema of custom markup language, enriched by XHTML. In simplified version, the XML documet could look like that: <a:alarm-manual xmlns:a="alarm-manual"...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
1
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.