very strange behavior......

77 views
Skip to first unread message

will

unread,
Aug 27, 2012, 10:44:38 PM8/27/12
to xpath...@googlegroups.com
i was recently using the Project Gutenberg Catalog ( http://www.gutenberg.org/feeds/catalog.rdf.zip ) to test out some XPath queries. Im sorry in advance for any difficulty you may find from reading the below but i would like to include full example and be very clear.

 I input the FIRST time into the XML: box, there was nothing in the XPath: box
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<pgterms:etext rdf:ID="etext11055">
  <dc:publisher>&pg;</dc:publisher>
  <dc:title rdf:parseType="Literal">Lord Dolphin</dc:title>
  <dc:creator rdf:parseType="Literal">Cheever, Harriet A. (Harriet Anna)</dc:creator>
  <dc:contributor rdf:parseType="Literal">Horne, Diantha W. [Illustrator]</dc:contributor>
  <pgterms:friendlytitle rdf:parseType="Literal">Lord Dolphin by Harriet A.  Cheever</pgterms:friendlytitle>
  <dc:language><dcterms:ISO639-2><rdf:value>en</rdf:value></dcterms:ISO639-2></dc:language>
  <dc:subject><dcterms:LCSH><rdf:value>Dolphins -- Juvenile fiction</rdf:value></dcterms:LCSH></dc:subject>
  <dc:subject><dcterms:LCC><rdf:value>PZ</rdf:value></dcterms:LCC></dc:subject>
  <dc:created><dcterms:W3CDTF><rdf:value>2004-02-01</rdf:value></dcterms:W3CDTF></dc:created>
  <pgterms:downloads><xsd:nonNegativeInteger><rdf:value>12</rdf:value></xsd:nonNegativeInteger></pgterms:downloads>
  <dc:rights rdf:resource="&lic;" />
</pgterms:etext>


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

i clicked the Fix! button and no errors were thrown, i received this output

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<pgterms:etext rdf:ID="etext11055" xmlns:dc="http://generated.ns/dc" xmlns:xsd="http://generated.ns/xsd" xmlns:rdf="http://generated.ns/rdf" xmlns:dcterms="http://generated.ns/dcterms" xmlns:pgterms="http://generated.ns/pgterms">
  
  <dc:publisher>&pg;</dc:publisher>
  
  <dc:title rdf:parseType="Literal">Lord Dolphin</dc:title>
  
  <dc:creator rdf:parseType="Literal">Cheever, Harriet A. (Harriet Anna)</dc:creator>
  
  <dc:contributor rdf:parseType="Literal">Horne, Diantha W. [Illustrator]</dc:contributor>
  
  <pgterms:friendlytitle rdf:parseType="Literal">Lord Dolphin by Harriet A.  Cheever</pgterms:friendlytitle>
  
  <dc:language>
    
    <dcterms:ISO639-2>
      
      <rdf:value>en</rdf:value>
      
    </dcterms:ISO639-2>
    
  </dc:language>
  
  <dc:subject>
    
    <dcterms:LCSH>
      
      <rdf:value>Dolphins -- Juvenile fiction</rdf:value>
      
    </dcterms:LCSH>
    
  </dc:subject>
  
  <dc:subject>
    
    <dcterms:LCC>
      
      <rdf:value>PZ</rdf:value>
      
    </dcterms:LCC>
    
  </dc:subject>
  
  <dc:created>
    
    <dcterms:W3CDTF>
      
      <rdf:value>2004-02-01</rdf:value>
      
    </dcterms:W3CDTF>
    
  </dc:created>
  
  <pgterms:downloads>
    
    <xsd:nonNegativeInteger>
      
      <rdf:value>12</rdf:value>
      
    </xsd:nonNegativeInteger>
    
  </pgterms:downloads>
  
  <dc:rights rdf:resource="&lic;" />
  
</pgterms:etext>

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

NOTE:: addition of "  xmlns:dc="http://generated.ns/dc" xmlns:xsd="http://generated.ns/xsd" xmlns:rdf="http://generated.ns/rdf" xmlns:dcterms="http://generated.ns/dcterms" xmlns:pgterms="http://generated.ns/pgterms" " to first element

i then tried clicking Color!, Format!, and Validate! all of which threw similar error to below,

"Something went wrong:The entity "pg" was referenced, but not declared"

however, the Fix! button still worked ( and will continue to work for the duration ).  I proceeded to scan through my XML and saw the element

<dc:publisher>&pg;</dc:publisher>

figuring it was the & in front of "&pg;" throwing the error i deleted that element and tried the Color!, Format!, and Validate! buttons again and they all threw similar error to below,

Something went wrong:The entity "lic" was referenced, but not declared

at the bottom of the XML was the element

<dc:rights rdf:resource="&lic;" />

 i deleted this element and tried the Format! button, to which i received this output

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<?xml version="1.0" encoding="UTF-8"?>

<pgterms:etext xmlns:pgterms="http://generated.ns/pgterms" xmlns:dc="http://generated.ns/dc" xmlns:xsd="http://generated.ns/xsd" xmlns:rdf="http://generated.ns/rdf" xmlns:dcterms="http://generated.ns/dcterms" rdf:ID="etext11055">  
  <dc:title rdf:parseType="Literal">Lord Dolphin</dc:title>  
  <dc:creator rdf:parseType="Literal">Cheever, Harriet A. (Harriet Anna)</dc:creator>  
  <dc:contributor rdf:parseType="Literal">Horne, Diantha W. [Illustrator]</dc:contributor>  
  <pgterms:friendlytitle rdf:parseType="Literal">Lord Dolphin by Harriet A. Cheever</pgterms:friendlytitle>  
  <dc:language> 
    <dcterms:ISO639-2> 
      <rdf:value>en</rdf:value> 
    </dcterms:ISO639-2> 
  </dc:language>  
  <dc:subject> 
    <dcterms:LCSH> 
      <rdf:value>Dolphins -- Juvenile fiction</rdf:value> 
    </dcterms:LCSH> 
  </dc:subject>  
  <dc:subject> 
    <dcterms:LCC> 
      <rdf:value>PZ</rdf:value> 
    </dcterms:LCC> 
  </dc:subject>  
  <dc:created> 
    <dcterms:W3CDTF> 
      <rdf:value>2004-02-01</rdf:value> 
    </dcterms:W3CDTF> 
  </dc:created>  
  <pgterms:downloads> 
    <xsd:nonNegativeInteger> 
      <rdf:value>12</rdf:value> 
    </xsd:nonNegativeInteger> 
  </pgterms:downloads> 
</pgterms:etext>

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

at this point all other buttons seemed to work as intended.  The addition of the URLS after the first Fix!ing made me wonder so i checked out the Project Guttenberg page further and found that their XML catalog follows the Resource Description Format http://www.w3.org/RDF/ and further more the DCMI recommendation http://dublincore.org/documents/dc-rdf/, i did no further research as it would distract me from the original reason of testing XPath.

I am a senior at university and need to in someway participate in a software project (create, code, test etc) for my programming capstone course, i need to first check with professor but if further testing and development to fix these problems is acceptable for final project i will be willing to dedicate many hours in the next 3.5 months to testing/fixing this problem, please let me know if this is a possiblity, and i will in turn check with prof.  thank you for your time


WO
Reply all
Reply to author
Forward
0 new messages