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

Q: attribute default name space


Hello

What is the correct way to associate the attributes with the tag if the
tag has a name space associated with it and the attribute doesn't have a
name space?

i.e.
<mytag
xmlns:mine="my/default/name/space"
xmlns:theirs="Some/one/elses/name/space" >

<mine:atag mine:attr1="my value" attr1="whatever" theirs:attr1="another">

</mine:atag>
</mytag>
The parser shows that mytag is in "my/default/name/space", and

`mine:attr1' is in "my/default/name/space"
`theirs:attr1' is in "Some/one/elses/name/space".
`attr1' is not in a name space
Is there a "correct" way to interpret this? Which attribute should be
associated with the tag? Obviously (?) not `theirs', but I would think
that most commonly an attribute won't have a name space, whereas a tag
commonly would, so the unspaced attribute would normally "go with" a tag
even though the name space is wrong, but the above appears valid, so how
is this interpreted?

malcolm

Jul 20 '05 #1
2 1577
In article <40******@news.victoria.tc.ca>,
Malcolm Dew-Jones <yf***@vtn1.victoria.tc.ca> wrote:
What is the correct way to associate the attributes with the tag if the
tag has a name space associated with it and the attribute doesn't have a
name space?
Elements are no namespace are interpreted according to the element they
appear on.
<mytag
xmlns:mine="my/default/name/space"
xmlns:theirs="Some/one/elses/name/space" >

<mine:atag mine:attr1="my value" attr1="whatever" theirs:attr1="another">


So in this case you would expect to find the "attr1" attribute described
along with the description of mine:atag.

-- Richard
Jul 20 '05 #2
yf***@vtn1.victoria.tc.ca (Malcolm Dew-Jones) writes:
The parser shows that mytag is in "my/default/name/space", and

`mine:attr1' is in "my/default/name/space"
`theirs:attr1' is in "Some/one/elses/name/space".
`attr1' is not in a name space
Is there a "correct" way to interpret this?
If by 'interpret' you mean 'associate each attribute with
a namespace (or not, as the case may be)', the correct interpretation
is the one you reproduce. If by 'interpret' you mean something
else, like mapping into some appliction semantics, then that
depends on the definitions of the elements and attributes you
are using.
Which attribute should be
associated with the tag?


All of the attributes should be associated with the element.
All of them occur on the element's start-tag. You don't need
to choose among them.

I hope this helps.

-C. M. Sperberg-McQueen
World Wide Web Consortium / MIT CSAIL
Jul 20 '05 #3

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

Similar topics

2
by: Gabriel Genellina | last post by:
Hi In the following code sample, I have: - a Worker class, which could have a lot of methods and attributes. In particular, it has a 'bar' attribute. This class can be modified as needed. - a...
7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
4
by: Lénaïc Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've some namespace problems when defining default values for attributes. My problem seems to come from the fact that the attributes are...
2
by: Bill Cohagan | last post by:
In my app I'm validating an XML file against an XSD which contains several attribute default value specifications. I'm performing the validation via an xml document load() using a...
12
by: Stefano | last post by:
Hi all, what is the correct use of the "default" attribute in XML Schema? For example: <xs:element name="myProperty" type="xs:string" default="myDefaultValue"/> What can I do with it? What...
2
by: Nicolas | last post by:
Hi everybody... In Xerces 2.7.0 it is explicitly stated that, no matter how one removes an attribute (attList->removeNamedItem, attList->removeNamedItemNS, domElement->removeAttributeNode,...
5
by: patrin | last post by:
Hi All, given the source document: <?xml version="1.0" encoding="UTF-8"?> <root> <child> <test id="1" name="first child"/> </child> <child>
9
by: Mark Olbert | last post by:
I'm trying to serialize (using XmlSerializer.Serialize) a class that I generated from an XSD schema using XSD.EXE /c. The problem I'm running into is that the root element needs to be unqualified,...
5
by: John Gordon | last post by:
My XSLT files have many occurrences of this general pattern: <a> <xsl:attribute name="href"> <xsl:value-of select="xyz" /> </xsl:attribute> </a> When I execute an XSL transform, the...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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: 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...

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.