RDF parsed even though it is not valid XML

RESOLVED DUPLICATE of bug 256430

Status

defect
RESOLVED DUPLICATE of bug 256430
15 years ago
11 months ago

People

(Reporter: jsridhar, Unassigned)

Tracking

Trunk
x86
Linux

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

Reporter

Description

15 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040530 Firefox/0.8
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040530 Firefox/0.8

The following RDF is parsed and shown inside a template code even though is not
valid XML (Element <RDF:Seq> ending with </RDF:Description>)

<?xml version="1.0"?>
<RDF:RDF xmlns:ex="http://www.example.net/EX-rdf#"
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <RDF:Seq about="chrome://wax/content/joe">
   <RDF:li>
    <RDF:Description>
     <ex:jack>224</ex:jack>
    </RDF:Description>
   </RDF:li>
  </RDF:Description>

</RDF:RDF>

Displays content (<ex:jack>224</ex:jack>) in the template
<vbox datasources="joe.rdf" ref="chrome://example/content/joe">
 <label value="joe"/>
 <template>
  <label uri="rdf:*" value="rdf:http://www.example.net/EX-rdf#jack"/>
 </template>
</vbox>


Reproducible: Always
Steps to Reproduce:
1. Create the following file, joe.rdf

<?xml version="1.0"?>
<RDF:RDF xmlns:ex="http://www.example.net/EX-rdf#"
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <RDF:Seq about="chrome://wax/content/joe">
   <RDF:li>
    <RDF:Description>
     <ex:jack>224</ex:jack>
    </RDF:Description>
   </RDF:li>
  </RDF:Description>

</RDF:RDF>

2. Use template code in a XUL file

<vbox datasources="joe.rdf" ref="chrome://example/content/joe">
 <label value="joe"/>
 <template>
  <label uri="rdf:*" value="rdf:http://www.example.net/EX-rdf#jack"/>
 </template>
</vbox>

3. The label "joe" and value "224" are displayed



Expected Results:  
Should have got an exception since the RDF xml is not valid.
Reporter

Comment 1

15 years ago
(In reply to comment #0)
> User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040530 Firefox/0.8
> Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040530 Firefox/0.8
> 
> The following RDF is parsed and shown inside a template code even though is not
> valid XML (Element <RDF:Seq> ending with </RDF:Description>)
> 
> <?xml version="1.0"?>
> <RDF:RDF xmlns:ex="http://www.example.net/EX-rdf#"
>          xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
>   <RDF:Seq about="chrome://wax/content/joe">
>    <RDF:li>
>     <RDF:Description>
>      <ex:jack>224</ex:jack>
>     </RDF:Description>
>    </RDF:li>
>   </RDF:Description>
> 
> </RDF:RDF>
> 
> Displays content (<ex:jack>224</ex:jack>) in the template
> <vbox datasources="joe.rdf" ref="chrome://example/content/joe">
>  <label value="joe"/>
>  <template>
>   <label uri="rdf:*" value="rdf:http://www.example.net/EX-rdf#jack"/>
>  </template>
> </vbox>
> 
> 
> Reproducible: Always
> Steps to Reproduce:
> 1. Create the following file, joe.rdf
> 
> <?xml version="1.0"?>
> <RDF:RDF xmlns:ex="http://www.example.net/EX-rdf#"
>          xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
>   <RDF:Seq about="chrome://wax/content/joe">
>    <RDF:li>
>     <RDF:Description>
>      <ex:jack>224</ex:jack>
>     </RDF:Description>
>    </RDF:li>
>   </RDF:Description>
> 
> </RDF:RDF>
> 
> 2. Use template code in a XUL file
> 
> <vbox datasources="joe.rdf" ref="chrome://example/content/joe">
>  <label value="joe"/>
>  <template>
>   <label uri="rdf:*" value="rdf:http://www.example.net/EX-rdf#jack"/>
>  </template>
> </vbox>
> 
> 3. The label "joe" and value "224" are displayed
> 
> 
> 
> Expected Results:  
> Should have got an exception since the RDF xml is not valid.

Oops! sorry, cut'n'paste demons playing havoc. Please change 
<vbox datasources="joe.rdf" ref="chrome://example/content/joe">

to 
<vbox datasources="joe.rdf" ref="chrome://wax/content/joe">

Sorry about that.

Comment 2

15 years ago
The XML spec gives two options for not-well-formed XML: you can reject the
entire document, or you can parse up to the first well-formedness error and then
bail. In the case of RDF we follow the second policy, and we remain within all
specs that I'm aware of. (We should probably report the parsing error to the JS
console, but that's a different problem). Pike, I think this is INVALID; do you
agree?

Comment 3

15 years ago
Reporter, I was almost taking this bug, but I decided to create a new one. Please
attach testcases instead of pasting them into the bug. And of course, don't paste
them twice.
Rationale over in bug 256430.

*** This bug has been marked as a duplicate of 256430 ***
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Reporter

Comment 4

15 years ago
Reporter

Comment 5

15 years ago
Reporter

Comment 6

15 years ago

Updated

11 months ago
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.