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

Home Posts Topics Members FAQ

well formed attributes: no < ?

Hello,

I've been using XML for a while in a rather 'free' manner (i.e. as long as
IE accept it it's OK), I read recently (again) the Xml standard 1.0 (3rd
edition) and found this sentence:

Well-formedness constraint: No < in Attribute Values
The replacement text of any entity referred to directly or indirectly in an
attribute value MUST NOT contain a <.

it's seems to imply that:
<tag attr="&lt;" />
is not good XML. but for example the doc of XSL shows numerous samples where
&lt; is used in attributes. is the XSL doc wrong? or is this well-formedness
rule obsolete? or not enforced by anybody? or is this something else?

Regards
Armel
Jan 10 '06 #1
4 1894
In article <43**********************@news.wanadoo.fr>,
Armel Asselin <ar**********@hotmail.com> wrote:
Well-formedness constraint: No < in Attribute Values
The replacement text of any entity referred to directly or indirectly in an
attribute value MUST NOT contain a <.

it's seems to imply that:
<tag attr="&lt;" />
is not good XML. but for example the doc of XSL shows numerous samples where
&lt; is used in attributes. is the XSL doc wrong? or is this well-formedness
rule obsolete? or not enforced by anybody? or is this something else?


You have misunderstood the rule. It means that
<tag attr="<" />
is illegal.

The replacement text of the entity reference in
<tag attr="&lt;" />
is
<
(or something similar) which does not contain a < character.

-- Richard
Jan 10 '06 #2
"Richard Tobin" <ri*****@cogsci.ed.ac.uk> a écrit
You have misunderstood the rule. It means that
<tag attr="<" />
is illegal. ok... :) The replacement text of the entity reference in
<tag attr="&lt;" />
is
<
(or something similar) which does not contain a < character.

this is the 'double encoding' stuff in definitions so...

thank you very much
Armel
Jan 10 '06 #3
Armel Asselin (ar**********@hotmail.com) wrote:
: Hello,

: I've been using XML for a while in a rather 'free' manner (i.e. as long as
: IE accept it it's OK), I read recently (again) the Xml standard 1.0 (3rd
: edition) and found this sentence:

: Well-formedness constraint: No < in Attribute Values
: The replacement text of any entity referred to directly or indirectly in an
: attribute value MUST NOT contain a <.

: it's seems to imply that:
: <tag attr="&lt;" />
: is not good XML.

I think the standard means no _unescaped_ < should ever appear.

You can put anything you wish in the value as long as it is correctly
escaped.

May 18 '06 #4
Malcolm Dew-Jones wrote:
You can put anything you wish in the value as long as it is correctly
escaped.


Almost. In XML 1.0, characters that weren't in the official XML
character set weren't permitted even as numeric character references; to
represent them you had to translate them using some other representation
such as base-64 encoding or your own custom escaping mechanism. I seem
to remember that 1.1 relaxed that, but I may be misremembering.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
May 19 '06 #5

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

Similar topics

3
by: Ken Fine | last post by:
I periodically receive a 5+ MB XML document that I hand-load into SQL Server using SQLXML running under a DTS process. Unfortunately, the document is human-created, and (very unfortunately) often...
1
by: bigbinc | last post by:
how do you print not well formed xml, for example using xslt, I want to print <TEST01> and thats it, obviously this is not well formed, so I cant print it with xslt. I have tried using CDATA...
2
by: Urs Muntwyler | last post by:
Hi there I have to check if the content of a file is a well-formed XML document. Since the XML documents can be large, I'm using SAX to perform this task. Using Java, my code looks (somehow)...
1
by: Ashish | last post by:
Hi Are there any functions in .Net which can be used to verify whether xml is well formed? Thanks, Ashish
11
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or...
2
by: Arpan | last post by:
I came across the following statement at http://windowssdk.msdn.microsoft.com/en-us/library/hdf992b8.aspx: Although an XML document is considered to be well formed if it meets all the...
4
by: VK | last post by:
Can well-formed but non-validated XHTML have extra namespaces? Say <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />...
2
by: Mikus Sleiners | last post by:
I want to create xml document that looks like this: <?xml version="1.0" encoding="utf-16"?> <Draft xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
7
by: nadahalli | last post by:
Hello, I have an XSL file that has something like this: <xsl:if test-condition1> <body attribute1 attribute2> </xsl:if> <xsl:if test-condition2> <body attribute3 attribute4> </xsl:if>
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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: 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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.