File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes xpath and processing instructions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xpath and processing instructions " Watch "xpath and processing instructions " New topic

xpath and processing instructions

Daniel Salzer

Joined: Dec 19, 2003
Posts: 8
Hi XSLT/XPATH gurus,
I am converting an xml file into html. However, I want to list only the objects below that have the processing instructions "<?INSERT OBJECT?>" and filter out all the others. I know how to do that based on attributes or child element but not based on processing instructions.
Anybody ?
<OBJ_ATTR ADDRESS1="1100 Vernon Street">
So how do I formulate the "template select" for this ?

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl utput method="html"/>
<xsl:template match="/">
<title>New Objects</title>
<h1>New Objects</h1>
<xsl:apply-templates select = "???"/>

Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
May sound like a stupid question from me, but "What is the real use of having a XML structure like this ?"

Spritle Software Blogs
Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
this link will help you write XSLT for accessingPI, but as you can see, you need to change your xml structure a bit to achieve your task.
I agree. Here's the link:
subject: xpath and processing instructions
It's not a secret anymore!