What you want to do is to transform XML to some other XML, copying certain 
nodes and omitting others. The XML technology for this kind of transformation 
is XSLT. XPath is the component of your XSL stylesheet that identifies the 
nodes in your input, XSLT as such is a declaration of what the output should 
look like.
Apache has an XSLT processor called Xalan and there are numerous others in the 
public domain. Or you will the facilities included in popular XML editors.

Anders
----- Original Message ----- 
From: "Kanarinka" <[EMAIL PROTECTED]>
To: <[email protected]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, March 07, 2002 4:42 PM
Subject: RE: XPath newbie question (another one)


> Hello All,
> I am also a newbie to xindice and xpath. I am wondering if it is
> possible to use Xpath to select a node without selecting its contents or
> all of its children. We are working on a project that will have elements
> that have sizable chunks of text data as their contents. In certain
> parts of the application we need to be able to represent the entire
> system's hierarchy, but we don't want to pull all of the contents of the
> nodes into memory.
> 
> Here's an example:
> 
> <lecture>
> <header>
> <id>2</id>
> <module_id>8</module_id>
> <title> Lecture 1: An introduction to nothing</title>
> </header>
> <contents>
> Blablahblahblahablahablahablahblah...really long
> contents here
> </contents>
> <topic>
> <header>
> <id>5</id>
> <module_id>3</module_id>
> <title> Topic 1: An introduction to
> nothing</title>
> </header>
> <contents>
> 
> Blablahblahblahablahablahablahblah...reallyreally long contents here
> </contents>
> </topic>
> </lecture> 
> 
> In this case, the information that we need to represent the lecture and
> topic nodes visually in our hierarchy lives in the <header> element,
> however in order to preserve the hierarchical representation of the
> <header> element we would like to select something like the following:
> 
> <lecture>
> <header>
> <id>2</id>
> <module_id>8</module_id>
> <title> Lecture 1: An introduction to nothing</title>
> </header>
> <topic>
> <header>
> <id>5</id>
> <module_id>3</module_id>
> <title> Topic 1: An introduction to
> nothing</title>
> </header>
> </topic>
> </lecture>
> 
> Is this possible with Xpath or can you folks think of a better way to do
> this? I apologize if this is very ignorant. 
> 
> Thanks for any help you can offer!
> catie
> 

Reply via email to