Bug 101508 - xmllint doesn't allow " in attribute values delimited by '
xmllint doesn't allow " in attribute values delimited by '
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: libxml2 (Show other bugs)
9
athlon Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Veillard
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-08-01 20:12 EDT by Need Real Name
Modified: 2007-04-18 12:56 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-08-02 09:49:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2003-08-01 20:12:29 EDT
Description of problem:

xmllint considers the following tag to be in error:

  <sect1 id='first"'>

However, the XML version 1.0, 2nd edition standard at 
http://www.w3.org/TR/2000/REC-xml-20001006 
defines the allowed syntax of an attribute value as

AttValue    ::=    '"' ([^<&"] | Reference)* '"'
                |  "'" ([^<&'] | Reference)* "'"

which allows double quotes (") within an attribute value if that attribute
value is delimited by single quotes (').

Version-Release number of selected component (if applicable):
2.5.4-1

How reproducible:
Every time.

Steps to Reproduce:
1. Create a file "foo.xml" with the following content:
<?xml version="1.0" ?>
<!DOCTYPE article PUBLIC  "-//OASIS//DTD DocBook XML V4.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<article>
  <sect1 id='first"'>
    <title>First</title>
    <para>foo bar baz</para>
  </sect1>
</article>

2. Run the command "xmllint --valid --noout foo.xml"
   
Actual results:

foo.xml:5: validity error: Syntax of value for attribute id of sect1 is not valid
  <sect1 id='first"'>
                    ^


Expected results:

Should not complain about the indicated attribute value.

Additional info:
Comment 1 Daniel Veillard 2003-08-02 09:49:33 EDT
Not a bug. The id attribute is defined as being of type ID by the
DocBook DTD and ' is not a valid character in such a name (it is not
possible to derive it from the Name production). It's a validity error,
not a well-formedness error. Your XML is well formed, but doesn't
match the requirement of the DocBook DTD. It's a good idea to spend
a bit more time reading that spec all the terms and behaviour I describe
are defined in it.

Daniel
 
Comment 2 Daniel Veillard 2003-08-02 10:23:48 EDT
To be more precise the validity constraint broken by your document
is http://www.w3.org/TR/REC-xml#id

Daniel

Note You need to log in before you can comment on or make changes to this bug.