Home > > Parsing xml with entity definitions inside it

Parsing xml with entity definitions inside it

Hello All,
I am trying to parse an xml file using DOM parser which has entities defined inside it for
eg: <!ENTITY sample SYSTEM "sample_data" NDATA sample_ndata >
and we are referring to the sample in some tag as value for attribute. When we try to parse the xml file its throwing saxexception
org.xml.sax.SAXParseException: UndeclaredEntity: Entity 'sample' is not declared.
     at com.sun.org.apache.xerces.internal.jaxp.validation.Util.toSAXParseException(Unknown Source)
     at com.sun.org.apache.xerces.internal.jaxp.validation.ErrorHandlerAdaptor.error(Unknown Source)
     at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
     at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
     at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
     at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
     at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(Unknown Source)
     at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source)
If anyone has faced same issue please help me in resolving the same. Appreciate any help.
Thanks DrClap !
Not a problem. Here are the first lines of the file. Note the first node follows directly after the first line, which is the XML declaration:
<?xml version="1.0" encoding="ISO-8859-1"?>
<result status="ok">
<stuff blah="omgwtflmao">
Also, thanks for pointing out what you did. I should have noticed the first line in the JDOM FAQ that said "even if the validator is turned off".
So... assuming my validator isn't turned off !?
Read the other 8 answers

Related Articles

I am getting followong error XML Parsing Error: undefined entity Location: chrome://weave/content/options.xul Line Number 6, Column 3: <setting id="weave-account" type="string" title="&account.label;" /> --^I had th
I'm having trouble adding an additional account to FireFTP. I keep getting a yellow box with this title: XML Parsing Error: undefined entity Location: chrome://fireftp/content/accountManager.xul Line Number 216, Column 17: <menu label="&charse
The full error message is the following: XML Parsing Error: Undefined entity Location chrome://mozapps/content/downloads/unknown content type.xul Line Number 30, Column 18In order to use ''nxm://'' links, Nexus Mod Manager must be installed and assoc
Hi, I wish to know is there any other parsers apart from JAXP to parse xml content present inside HTML file. For example, <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional
On Nokia N900. Was OK before, but now (since friday 27 aug 2010) gives: XML Parsing Error: undefined entity Location: http://mobil.aftonbladet.se/ Line number 18, Column 366: ...Hi, thanks for the reply. That site is OK now. If you have time, check o
dear friends, There are lots of topic talking about parse xml, validating xml with schema and so on, but no one or any book talking about parsing xml document which can parse document with link inside. According to Mr Meggison at http://www.megginson
I've just tried to open Auroara and am only getting a small window stating... XML Parsing Error: undefined entity Location: chrome://browser/content/browser.xul Line Number 540, Column 9: <button default="true"Start Firefox in <u>[[Safe
XML Parsing Error: undefined entity Location: jar:file:///C:/Users/Lisa/AppData/Roaming/Mozilla/Firefox/Profiles/7x7db74p.default/extensions/[email protected]/chrome/speedtest.jar!/content/netError.xhtml Line Number 392, Column 33:There have been pro
Since an automatic update ran I get the message <br /> "XML Parsing Error: undefined entity <br /> Location:chrome://browser/content/browser.xul <br /> Line Number 238, Column 5: <br /> <broadcaster id="devtoolsMenuBro
Firefox version 4.0.1 Firefox Sync Version 1.7 I have this combination installed on two different machines (one is WinXP, the other Win7). When I goto the Addons screen to see which addons are installed and I click the "option" button for the Fi
I am trying to parse an xml document in a java stored procedure. Just following my nose, I have developed a stored proc that works fine in development (outside the database using JRE 1.4.1) using the Xerces 2.5 parser. But, after having transferred t
Hi, I am trying to use a Sax parser for parsing xml received from a back end legacy system. The code is executed from a Session bean. Debugging learned me that the parse() method on the parser hangs the container without any error or exception trace.
Thank you for reading this email... If I have a **DTD** like: <!ELEMENT person (name, age)> <!ATTLIST person      id ID #REQUIRED > <!ELEMENT name ((family, given) | (given, family))> <!ELEMENT age (#PCDATA)> <!ELEMENT family (#
Hi All I want to parse xml document which contains more then one occurrence of particular element. I want to get some sub elements of that element and want take action on the basis of param tag inside this sub element. for example : <appender name=&quo
hi guys, I would like to know how to parse xml for an internal table. I explain myself. Let's say you have a purchase order form where you have header data & items data. In my interactive form, the user can change the purchase order quantity at the i
hi there!!! i don have much idea about parsing xml.. i have an xml file which consists of details regarding indentation and spacing standards of C lang.. i need to read the file using DOM parser in java n store each of the attributes n elements in so
          Hi           I am working on WLS 6.1sp2 and I am using jms TextMessage type of message to           send XML messages from one subsystem to another. I have added an XML registry           for my version of XML parser. Now I do not have any
Hi all. Im having problems on how to parse an xml by JSP Can anyone teach me how to parse an the XML below by jsp, without using taglibs. Im using JDOM... <Customer>            <DetailsCustomer ID = 1>            <Name>                  
This is happening with a "fresh" installation of flash builder 4.6 and it's driving me crazy:  During "export release build" I get the error: "Error occurred while packaging the application: aapt tool failed: c:\users\alfonso\AppD