ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Lévy-Lambert <>
Subject AW: XSLT with entities and therefore DOCTYPE
Date Mon, 08 Dec 2003 20:46:12 GMT
Hi Mike,

I am no great XSL expert.

Did you try the <xsl:import/> element instead of entities ?
Maybe you are having problems with the xml-apis.jar or the xercesImpl.jar
which is bundled with ant 1.5.3 ?
I am not sure, I hope someone else gives you better ideas.
Otherwise, there are certainly some xml lists where you could ask too.
BTW : the address of this mailing list is

-----Urspr√ľngliche Nachricht-----
Von: Mike Castle []
Gesendet: Montag, 8. Dezember 2003 21:23
Betreff: XSLT with entities and therefore DOCTYPE

I'm not sure if this is something that can be answered on this list.  I'm
hoping that at least I can be pointing to a better place to ask.

I'm delving into XSLT and have developed a transformation that works well
when I use it against xsltproc on my Linux box.  So I want to migrate this
to ant to be part of our build process, and I'm running across errors.

In particular, this example works well:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  <xsl:template match="/">

and from build.xml:
<target name="xslttest">
   <xslt in="build.xml" out="results.txt" style="demo.xsl"/>

Now, in my real version, I need to use entities, so I change it to
something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY foo "test">
<xsl:stylesheet version="1.0"
  <xsl:template match="/">

Which works fine with xsltproc, but ant 1.5.3 gives me:

     [xslt] Processing /homedir/mcastle/build.xml to
     [xslt] Loading stylesheet /homedir/mcastle/demo.xsl
     [xslt] [Error] demo.xsl:5:80: Element type "xsl:stylesheet" must be
     [xslt] [Error] demo.xsl:6:27: Element type "xsl:template" must be


Now, it turns out that results.txt actually holds the correct text, which
is great.  But that is an awful lot of noise on the screen, particularly
when my real case is much larger.  And that noise is distracting.

So, I've been trying to experiment with xsl:variable, but to no luck.  For
example, I really need to do something like the following:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  <xsl:template match="/">
    <xsl:variable name="foo">[test]</xsl:variable>
    <xsl:variable name="bar" select="/project/target$foo"/>
    <xsl:value-of select="$bar"/>

And I've tried several variations on this technique to no avail.

So, is there anyway I can get ant to convince XSLT not to validate the
stylesheet, even though it has a DOCTYPE (I really don't want to have to
write a DTD for this thing)?

Or would anyone know how to hammer xsl:variables into doing what I want?

Outside of that, where do I go to ask for help (specifically, what would
YOU recommend)?  My searches really haven't turned up too much useful
information, but I'm new enough to this that I am probably missing useful
terms that would help.

Thanks a lot,
     Mike Castle
    We are all of us living in the shadow of Manhattan.  -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); --

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message