nasar2016 / rdfquery

Automatically exported from code.google.com/p/rdfquery
0 stars 0 forks source link

RDFa Parser Can't Handle Less Than Symbol in Content Attribute #18

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create an HTML document with the symbol '<' in an RDFa content attribute
2. Don't escape the '<' symbol (as you would for XML) because HTML supports
it inline.
3. Put the property attribute _after_ the content attribute
4. Try parsing the file and note the the node is skipped because rdfquery
did not detect the property attribute.

Solution:
Always use the node.attributes node map to read the attributes.
Remove the if condition (always eval the block) on line 101
http://code.google.com/p/rdfquery/source/browse/trunk/jquery.rdfa.js#101

What version of the product are you using? On what operating system?
IE8

Please provide any additional information below.
Everything seems to work if the browser supports getNamedItemNS. If it
doesn't (as with IE) rdfquery tries to parse the attributes using a regex
that was written for an XML fragment and not an HTML fragment.

Original issue reported on code.google.com by james-no...@leighnet.ca on 27 Oct 2009 at 11:39

GoogleCodeExporter commented 8 years ago
Actually, it is the greater than symbol in the attributes that causes the regex 
to fail.

Original comment by james-no...@leighnet.ca on 2 Nov 2009 at 2:10

GoogleCodeExporter commented 8 years ago

Original comment by jeni.ten...@gmail.com on 2 Nov 2009 at 4:38