473,378 Members | 1,620 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,378 software developers and data experts.

xml-schema:Uniqueness attributes of differend elements

Hi

I want to define a schema for my xml. I want to transform the xml in
java-code by xslt, so it is important (for naming conflicts) that the
values of the name-attributes in the xml been unique.

I have a xml file like this:

<someroot>
<A_Item name="foo">
<B_Item name="123"/>
<B_Item name="456"/>
</A_Item>
<B_Item name="foo"/>
</someroot>

The '<B_Item name="foo"/>' must give an error by the validator check.
How can I do that with xml-schema?

Regards,
Thijs

Jul 20 '05 #1
2 1250


th**********@gmail.com wrote:

I have a xml file like this:

<someroot>
<A_Item name="foo">
<B_Item name="123"/>
<B_Item name="456"/>
</A_Item>
<B_Item name="foo"/>
</someroot>

The '<B_Item name="foo"/>' must give an error by the validator check.
How can I do that with xml-schema?


<xs:attribute name="name" type="xs:ID" />

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
Is it so easy?

Thanks

Thijs

Jul 20 '05 #3

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

Similar topics

4
by: Jyrki Keisala | last post by:
Hi, I have an XML file which I want to present as a HTML table, and I'm looking for a quick way of defaulting all empty elements in my XML file to a nbsp (using the   notation) in my XSL...
6
by: Hans Kamp | last post by:
My program fails reading XML attributes. A fragment of the code is: private void showXmlNodeAtTreeNode(XmlNodeList xnl, TreeNode tn) { int i; for (i = 0; i < xnl.Count; i++) { XmlNode xn =...
2
by: luke.crouch | last post by:
My server-side php script is generating an xml response with the following structure: <thread class='Columns'> <Id class='Column dataDetail'>12345</Id> <Command class='Column...
7
by: mjarends | last post by:
I'm using JAXP for XSLT - I'm using the examples from http://www.w3.org/TR/xslt#section-Examples. I'm using the following XML file: <?xml version="1.0" encoding="UTF-8"?> <sales> <division...
0
by: William | last post by:
I am getting a webservice error when using a couple of generated XsdObjectGen complex types. The WebMethod is something like: public RESPONSE_GROUP Order(REQUEST_GROUP rqst) { IOrder rObj =...
0
by: aeden.jameson | last post by:
Hi, I was wondering if somone could provide an outline of how I would go about implementing serialization that turns a string dictionary to XML attributes. For example, suppose I have ...
4
by: C.W.Holeman II | last post by:
Using: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 http://emle.sourceforge.net/emle020000/teste1.xml...
7
by: MaxMax | last post by:
I want to insert a white line between XML elements to raise human readability example: <MyNode> </MyNode> <MyNode> </MyNode>
2
by: Bostonian | last post by:
I am loading an Xml from a physical file and passing it to XSL transformation. When i load the file (C# code), InnerXML shows backslash before all the XML attributes. Xsl transformation crashes...
0
by: jeoffh | last post by:
Background: I am trying to "merge" some attributes into an existing XML column in my MS SQL 2005 database. The general idea is that I have an XML column in a table and I would like to update/delete...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.