You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Sh...@lotus.com on 2001/05/04 14:55:02 UTC

Re: xalan extension (see XPathAPI)

You'll get the best response to Xalan questions on the xalan-dev list (and
soon-to-be xalan-j-users list as well!).

But, you might want to start by looking at either our sample
xml-xalan/java/samples/ApplyXPath/ApplyXPath.java or the underlying API in
xml-xalan/java/src/org/apache/xpath/XPathAPI.java which should do what you
want.

- Shane

---- you "Roland Nelson" <ku...@gmx.de> wrote ----
is there by any way a possibility with xalan to do the following in Java,
based on a DOM:

    String string = "XalanDOM".getStringByXPathExpression("XPATH
EXPRESSION");

I have seen an interface for the "xt" engine but cannot seem to find a way
of doing this through xalan.
I would be extremely grateful for any help, tips on this matter if you have
any,

all the best from Frankfurt am Main, Germany,
Roland Nelson


Re: position() function

Posted by Gary L Peskin <ga...@firstech.com>.
Haven't seen your entire stylesheet, but check for blank text nodes in
your input XML between elements.  IE may be stripping these out whereas
Xalan will not unless you code an xsl:strip-space.

HTH,
Gary

Stefan De Cap wrote:
> 
> I have the following problem by using Xalan for an XSL transformation.
> 
> In the stylesheet I've the following code:
> 
> <xsl:number value="position()" format="1. "/>
> 
> I'm numbering the titles in my xml file automatically by using the
> position() function. But the HTML output contains only odd numbers.
> 
> When I open the XML file without transformation in my browser (internet
> explorer) there's no problem and the numbering is correct. So what's going
> wrong with the transformation to HTML.
> 
> Thanks in advance.

RE: position() function

Posted by Stefan De Cap <st...@skynet.be>.
Sorry, in fact you had already given me the answer: <xsl:strip-space
elements="wi:Work_Instruction"/>

Thanks! The blank linses between two elements were the problem. (that it was
that simple!)
But can somebody explain me why this blank lines such a problem?
And can I avoid the problem I had automatically?

Greetings, and thanks for your responses!

-----Original Message-----
From: Gary L Peskin [mailto:garyp@firstech.com]
Sent: vrijdag 4 mei 2001 21:37
To: xalan-dev@xml.apache.org
Subject: Re: position() function


Stefan --

First, try changing your third line to

  </wi:Revision_Information><wi:Purpose>

Note that there are no spaces or blank lines between the two elements.
See if this makes a difference.



RE: position() function

Posted by Stefan De Cap <st...@skynet.be>.
Thanks! The blank linses between two elements were the problem. (that it was
that simple!)
But can somebody explain me why this blank lines such a problem?
And can I avoid the problem I had automatically?

Greetings, and thanks for your responses!

-----Original Message-----
From: Gary L Peskin [mailto:garyp@firstech.com]
Sent: vrijdag 4 mei 2001 21:37
To: xalan-dev@xml.apache.org
Subject: Re: position() function


Stefan --

First, try changing your third line to

  </wi:Revision_Information><wi:Purpose>

Note that there are no spaces or blank lines between the two elements.
See if this makes a difference.



Re: position() function

Posted by Gary L Peskin <ga...@firstech.com>.
Stefan --

First, try changing your third line to

  </wi:Revision_Information><wi:Purpose>

Note that there are no spaces or blank lines between the two elements. 
See if this makes a difference.

Next, try to include the

  <xsl:strip-space elements="parent-of-wi:Revision_Information"/>

element as a top-level element in your stylesheet.  I don't know the
name of the parent of wi:Revision_Information but, obviously, that needs
to be substituted in the elements attribute above.

If neither of these produce the desired results, please send your full
XML and XSLT so that we can try to reproduce the problem. 
Alternatively, you'll probably get a quicker response (due to a larger
audience) on the Mulberry XSLT list at
http://www.mulberrytech.com/xsl/xsl-list/index.html

Gary

Stefan De Cap wrote:
> 
> Thanks for your reactions. I've added some extra information here
> 
> this is a part of the XML file:
> <wi:Revision_Information>
>         <wi:tag>-</wi:tag>
> </wi:Revision_Information>
> <wi:Purpose>
>         <wi:tag></wi:tag>
> </wi:Purpose>
> <wi:Users>
>         <wi:tag></wi:tag>
> </wi:Users>
> 
> The desired output has to be something like:
> 1. Revision Information
>         ...
> 2. Purpose
>         ...
> 3. Users
>         ...
> 
> The XSL document looks like:
> <xsl:template match="wi:Revision_Information">
>         <xsl:number value="position()" format="1. "/> Revision Information
> </xsl:template>
> 
> <xsl:template match="wi:Purpose">
> ... ...
> 
> Hoping you can help,
> 
> Stefan De Cap
> [mailto:stefan.de.cap@skynet.be]
> 
> I have the following problem by using Xalan for an XSL transformation.
> 
> In the stylesheet I've the following code:
> 
> <xsl:number value="position()" format="1. "/>
> 
> I'm numbering the titles in my xml file automatically by using the
> position() function. But the HTML output contains only odd numbers.
> 
> When I open the XML file without transformation in my browser (internet
> explorer) there's no problem and the numbering is correct. So what's going
> wrong with the transformation to HTML.
> 
> Thanks in advance.

RE: position() function

Posted by Stefan De Cap <st...@skynet.be>.
Thanks for your reactions. I've added some extra information here

this is a part of the XML file:
<wi:Revision_Information>
	<wi:tag>-</wi:tag>
</wi:Revision_Information>
<wi:Purpose>
	<wi:tag></wi:tag>
</wi:Purpose>
<wi:Users>
	<wi:tag></wi:tag>
</wi:Users>

The desired output has to be something like: 
1. Revision Information
	...
2. Purpose
	...
3. Users
	...

The XSL document looks like:
<xsl:template match="wi:Revision_Information">
	<xsl:number value="position()" format="1. "/> Revision Information
</xsl:template>

<xsl:template match="wi:Purpose">
... ...

Hoping you can help,

Stefan De Cap
[mailto:stefan.de.cap@skynet.be]

I have the following problem by using Xalan for an XSL transformation.

In the stylesheet I've the following code:

<xsl:number value="position()" format="1. "/>

I'm numbering the titles in my xml file automatically by using the
position() function. But the HTML output contains only odd numbers.

When I open the XML file without transformation in my browser (internet
explorer) there's no problem and the numbering is correct. So what's going
wrong with the transformation to HTML.

Thanks in advance.



position() function

Posted by Stefan De Cap <st...@skynet.be>.
I have the following problem by using Xalan for an XSL transformation.

In the stylesheet I've the following code:

<xsl:number value="position()" format="1. "/>

I'm numbering the titles in my xml file automatically by using the
position() function. But the HTML output contains only odd numbers.

When I open the XML file without transformation in my browser (internet
explorer) there's no problem and the numbering is correct. So what's going
wrong with the transformation to HTML.

Thanks in advance.