[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Problems with expat parsing entity string in element data...

  • From: Sean Pedersen <sean.pedersen@c...>
  • To: xml-dev@l...
  • Date: Wed, 02 May 2001 17:31:07 -0600 (MDT)

element cb
I am using expat to parse some simple xml messages.  I only use a
start element CB, end element CB, and element data CB.  I discovered
recently that if the element data contains entities (like '&apos;'),
it breaks the element data text apart and makes multiple calls to my
element data CB.  Since I was assuming that the element data CB would
receive everything between the start and end tag (ie. the len parameter
would be that large), I don't do any state tracking.  Now that I know
the inclusion of entities will result in multiple calls to the the
element data CB, I will have add state maintainence code.  Is there
any way to force expat to NOT seperate the element data when it includes
entities?

I realize that expat is probably conforming to some XML standards
requirement, but I don't know XML that well, so I don't know.  I have
read the article on expat by Clark Cooper, and the expat FAQ, but did
not find the answer to my problem there.  If someone could point me in
the right direction, I would appreciate it.

Also, why will a '%' character be converted to '%25' by expat?  Since my
code has to do some encoding after processing ( '&', '=', and '%'), this
action by expat complicates my task.

Thanks for any help.                             -- Sean Pedersen


----------------------------------------------------------------------------
|                                                                          |
|  "A ship in a harbor is safe but that is not what ships are built for."  |
|                                                                          |
|  Sean Pedersen                               sean.pedersen@c...  |
|  Software Engineer II                           Office:  (719) 785 2313  |
|  USA.NET, Colorado Springs, CO                  Fax:     (719) 785 2361  |
----------------------------------------------------------------------------


____________________________________________________________________
This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

Purchase Stylus Studio Online Today!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.