473,322 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Parsing of an entity if it appears as an attribute value.

Hi,

I am developing an application using the SAX interface provided by
"xerces-j 2.6.0". My application does not need a DTD for execution as
it is not supposed to perform any validation. I have to provide
customized entity processing for which I have implemented the
startEntity function of the LexicalHandler interface. The problem that
I am facing is with respect to any entity other than the 5 builtin
ones. If any entity for example &abcd; which is not a built-in entity
is specified in the content of any element then it gets successfully
processed using the customized entity resolution provided in the
startEntity function, but if the same entity occurs in the value of an
attribute then it is not getting processed. In such cases the
startEntity function is also not getting called. On looking up the
value of the attribute in the startElement callback, I found that the
entity is not being passed on instead it is being consumed. Only the
five built-in entites if they are present are returned back in the
call-back.

I would be grateful if anybody can suggest a solution for this
peculiar problem.

Thankx,
Vineeth
Jul 20 '05 #1
3 1724
In article <c4**************************@posting.google.com >,
Vineeth <vi***************@gmail.com> wrote:
My application does not need a DTD for execution as
it is not supposed to perform any validation.
But then you say:
The problem that
I am facing is with respect to any entity other than the 5 builtin
ones.


So you *do* need a DTD. DTD's aren't just for validation. If you want to
use non-built-in entities, you need a DTD. Even if you managed to hack
around it, you would not be using XML, but a proprietary variant.

Why not use a DTD?

-- Richard
Jul 20 '05 #2
Hi Richard,

I have written my own entity resolver and I will be using it to resolve
the entities. I donot have any dependency on the DTD. What I need is a
way to get at the non normalized value of the attribute. Moreover I have
a large number of DTD's due to which I donot want to keep dependency of
the conversion process on the DTD.

Thanks
Vineeth

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3
ri*****@cogsci.ed.ac.uk (Richard Tobin) wrote in message news:<cm***********@pc-news.cogsci.ed.ac.uk>...
In article <c4**************************@posting.google.com >,
Vineeth <vi***************@gmail.com> wrote:
My application does not need a DTD for execution as
it is not supposed to perform any validation.


But then you say:
The problem that
I am facing is with respect to any entity other than the 5 builtin
ones.


So you *do* need a DTD. DTD's aren't just for validation. If you want to
use non-built-in entities, you need a DTD. Even if you managed to hack
around it, you would not be using XML, but a proprietary variant.

Why not use a DTD?

-- Richard

Hi Richard,

The problem with DTD is that my application does not have access to
the DTD. The basic functionality of my application is to convert the
XML document into a text based format document. I have written an
entityResolver implementing the Lexicalhandler interface, this
Resolver is called if the entity occurs in the content but it does not
get called up if the entity occur as an attribute value.

I somehow need access to the NonNormalized value of the attribute.

Any suggestions are welcome.

--Vineeth
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Willem Ligtenberg | last post by:
I decided to use SAX to parse my xml file. But the parser crashes on: File "/usr/lib/python2.3/site-packages/_xmlplus/sax/handler.py", line 38, in fatalError raise exception...
11
by: Douglas Reith | last post by:
Hi There, Can someone please tell me why the XML spec states that an attribute value with an external entity is forbidden? Or point me to the appropriate document? Or better still, perhaps you...
2
by: Christoph Niemann | last post by:
Hello, I want to output an element with an attribute. The attribute's value shall contain a entity reference. Is that possible at all? I use this source-XML and xsl-stylesheet: <?xml...
6
by: Vincent van Beveren | last post by:
Hey everyone, I try to insert a special character into my HTML using the DOM. I do this by the following piece of code: document.getElementById('space')....
1
by: google | last post by:
It would seem that when I assign an HTML entity to a form text input using "inline" javascript that it will display properly. But when trying to set it via a function call, the entity text shows...
4
by: Max | last post by:
I am writing a XML parser in Javascript and i have difficulty to understand the specifics of some "entities". I would want to understand the way in which the non-validating XML Parsers manage...
1
by: David Williams | last post by:
Has the Schema of the Web.Config changed in Web App Projects? After converting my 2005 Web Site project to a 2005 WAP, and switching to IIS Web Server, I am getting a number of errors at run time...
0
by: bruce | last post by:
hi... it appears that i'm running into a possible problem with mechanize/browser/python rgarding the "select_form" method. i've tried the following and get the error listed: br.select_form(nr...
9
by: Max | last post by:
Hello! I would want to know if attributes values can be entity references and if the parser, during processing, can replace with blank string a non registered entity. Eg: <example...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.