LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-06-2008, 02:40 PM   #1
abolishtheun
Member
 
Registered: Mar 2008
Posts: 183

Rep: Reputation: 31
xml - character data location


In xml, can I assume that character data is always located between 1) a start tag and a start tag, 2) a start tag and it's corresponding end tag, or 3) an end tag and an end tag?

Code:
<foo>case1
  <bar>case2</bar>
  case3
</foo>
I ask because I'm trying to learn a streaming xml parser (expat) and often, contigious character data blocks are broken up into more than one calls to the chardata handler, so I need a way of delimiting it reliably to know when it's over.
 
Old 04-06-2008, 04:00 PM   #2
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573

Rep: Reputation: 61
You will know that the data stream is finished when the root tag is closed. So in your example <foo> is closed by </foo>. There can only be one root level tag in an XML file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Need-to-Know XML Data Sets for Security LXer Syndicated Linux News 0 07-14-2006 07:54 AM
Location for script data storage Skazi Linux - General 1 10-15-2005 09:55 AM
Paging data from XML with PHP Boby Programming 1 03-23-2005 09:57 AM
MySQL data Location. AbsoluteMonkey Linux - General 2 12-22-2004 04:58 PM
SUsE 8.2 MySQL data location? xardoz Linux - General 1 04-16-2004 10:26 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration