Jun
Jun

Reputation: 183

How to get the content between different xml tags

Here is a fragment of my xml document:

<Title>example<\title>
This article is an example
<section>intro<\section>
<p> bla blablablablablablablablabla.
Here is an image <image>blablablabla<\image> <caption>example image<\image>
</p>
.
.
.
.

The tags are nested so first I need to get the structure of the doc and then the content. How to scan the doc and get the whole structure?

It is easy to get "exmaple" between <\title>. How to only get the content "This article is an example", which is not enclosed by any tags.

Upvotes: 0

Views: 133

Answers (1)

gprathour
gprathour

Reputation: 15333

Firstly, the xml file you are showing here for example is not a valid xml file. It does not follow xml conventions. You can learn about xml files from here

Secondly, tt depends which language you are using for your app and how you want to access it.

Example, you can access its memebers from JavaScript using DOM. A very simple way. You can get help about it from here.

Upvotes: 1

Related Questions