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

Declaring a global ID Attribute

Hi all,

I've got an XSD file that I need to add support to for an optional ID
attribute on elements. After many hours of tweaking all that I get to
work in my XML file is:

<Container id="CT"<!-- Valid ID declaration -->
<Stuff id="CT-1">Foo Bar</Stuff<!-- Invalid ID declaration-->
</Container>

I got this to work by adding an:

<xs:attribute name="id" type="xs:ID"/>
just under by <xs:schema ...line and then:

<xs:complexType name="Container">
<xs:sequence>
<xs:element name="Stuff" type="StuffText" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="id"/<!-- I added this line -->
</xs:complexType>

From what I've read I can do this by declaring the elements separatley
but the schema is quite large at over 50K, so I'm guessing there MUST be
a way to globally declare the use of an optional ID attribute on elements.

If I change the elementFromDefault to "unqualified" I can get the ID to
work but it then breaks other stuff within the XSD.

Can anyone point me in the right direction here please.

Thanks.
Oct 6 '07 #1
3 2244
Hi Bubba,

It is difficult for me to understand very well your message but, in
any case, you might take a look at the XML Schema for XML Schemas as
there it is defined an optional id attribute that can appear on schema
components, so it may be a good example to follow:

http://www.w3.org/TR/xmlschema-1/#no...e-schemaSchema

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina - http://aboutxml.blogspot.com/
<oXygen/XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Oct 8 '07 #2
George Bina wrote:
Hi Bubba,

It is difficult for me to understand very well your message but, in
any case, you might take a look at the XML Schema for XML Schemas as
there it is defined an optional id attribute that can appear on schema
components, so it may be a good example to follow:

http://www.w3.org/TR/xmlschema-1/#no...e-schemaSchema

Best Regards,
George
Hi George,

Thanks for the reply, but this is over my head, I can't disclose the
schema here as it's proprietry to the creator and confidential.

All I can say at best is that there are many simpleType definitions
followed by complexType definitions, however none of the complexType are
'wrapped' in <xs:elementtags as I've seen in O'reilly's XML Schema book.

Below is a representation of the structure of the schema I have.

<xs:schema ...>
<xs:simpleType name="Blah">
....
</xs:simpleType>

More simpleTypes

<xs:complexType name="Foo">
<xs:sequence>
<xs:element name="Bar" type="Blah" minOccurs="0" />
<xs:element ... />
...
</xs:sequence>
</xs:complexType>

More complexTypes...

<xs:complexType name="Master">
<xs:sequence>
<xs:element name="B" type="Foo" minOccurs="0"/>
...
</xs:sequence>
</xs:complexType>

and finally

<xs:element name="M" type="Master" />
</xs:schema>

I'm really confused here as I know this 'global' id attribute is
supported but for the life of me I can't work out how to fix this.

I'd really appreciate any help I can get with this.

--
Bubba

Oct 8 '07 #3
Hi Bubba,

My suggestion is to try a clean start with just a couple of elements
and types. Chances are that you will solve the problem as you try to
create this simple example but even if you do not figure that out you
will end up with a complete example that will help you define the
exact problem and will increase your chances to get a helpful reply.

Best Regards,
George
Oct 8 '07 #4

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

Similar topics

5
by: Carlos Ribeiro | last post by:
Hello all, I'm posting this to the list with the intention to form a group of people interested in this type of solution. I'm not going to spam the list with it, unless for occasional and...
8
by: lawrence | last post by:
I'm learning Javascript. I downloaded a script for study. Please tell me how the variable "loop" can have scope in the first function when it is altered in the second function? It is not defined...
5
by: fred | last post by:
I don't know if I'm doing this correctly. I have a little programming experience in python, c++ and some others but this is my first time with javascript. I'm trying have my website detect the...
2
by: Michael Tissington | last post by:
How do I specify the CodeFile for my Global.asax file ? According to the documentation I can use the CodeFile attribute with Application, however when I try to use this I get an error saying that...
2
by: TARUN | last post by:
I have a question about declaring the Global.ascx: In VS.NET I create a Solution, and there are 4 projects under it. They are put under 4 folders, but web pages would be called across the 4...
8
by: Rob T | last post by:
When I was using VS2003, I was able to compile my asp.net project locally on my machine and copy it to the production server and it would run just fine. I've now converted to VS2005. The project...
8
by: SM | last post by:
I've always wonder if there is diference when declaring and initializing a varible inside/outside a loop. What's a better practice? Declaring and initializing variables inside a loop routine,...
5
by: Rahul B | last post by:
Hi, I have very little knowledge about creating Procedures/functions in DB2. When i tried to create the test function like CREATE FUNCTION GET_TEST (P_TEST_ID INTEGER, P_SEL_OR_SORT...
2
by: MLH | last post by:
I'm wondering about Public VS Global kewords that can be used in procedures inside global modules saved/viewd in the modules tab of the database window. Is it pretty much the same thing to use one...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.