Closed Bug 256403 Opened 20 years ago Closed 20 years ago

RDF parsed even though it is not valid XML

Categories

(Core Graveyard :: RDF, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 256430

People

(Reporter: jsridhar, Unassigned)

Details

Attachments

(3 files)

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.
(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.
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?
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: 20 years ago
Resolution: --- → DUPLICATE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: