OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] getting text from external xml file

Great it works !

I did this in the ant build file to pass the pom file to the fo.xsl (I manage several projects, my task is dynamic) :
    <property name="pom" value="${basedir}/../${project.dir}/pom.xml" />
    <xslt basedir="${basedir}" style="${style.file}"
          in="tmpfile" out="${output}" extension="${extension}">
      <param name="pomfile" expression="${pom}" />

Then, in my fo.xsl I add this to create the param :
  <xsl:param name="pomfile"></xsl:param>

and get the version in it as you said :
<xsl:value-of select="document($pomfile)/ms:project/ms:version"/>

thank you very much for your precious help !


Dave Pawson a écrit :
Marie Sauvage - EBM WebSourcing wrote:
To pass it as a parameter would be easy for me, as I get it in my ant script before to call the generation !
How can I pass it as a parameter ?

From the command line,

saxon inputFile.xml stylesheet.xsl date=2007-07031

But can you tell me more about the xpath solution ? or maybe give me a link to where to find doc about it ?
I think it could be better to have it directly in the stylesheet.

With the input file
<project xmlns="http://maven.apache.org/POM/4.0.0"

    <name>My Project</name>


It would be

<xsl:value-of select="document('x.xml')/ms:project/ms:version"/>
if you wanted version
<xsl:value-of select="document('x.xml')/ms:project/ms:ModelVersion"/>

to get 4.0.0


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]