Bug 101508

Summary: xmllint doesn't allow " in attribute values delimited by '
Product: [Retired] Red Hat Linux Reporter: Need Real Name <kvanhorn>
Component: libxml2Assignee: Daniel Veillard <veillard>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: athlon   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-08-02 13:49:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Need Real Name 2003-08-02 00:12:29 UTC
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 
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):

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"
  <sect1 id='first"'>
    <para>foo bar baz</para>

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 13:49:33 UTC
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.


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