ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Koberg <...@koberg.com>
Subject Re: AW: XSLT with entities and therefore DOCTYPE
Date Mon, 08 Dec 2003 21:10:05 GMT

> -----Urspr√ľngliche Nachricht-----
> Von: Mike Castle [mailto:dalgoda@ix.netcom.com]
> Gesendet: Montag, 8. Dezember 2003 21:23
> An: ant-user@jakarta.apache.org
> Betreff: XSLT with entities and therefore DOCTYPE
>
<snip/>

There is the mulberrytech xsl-list that is a very good resource. I will 
try to answer inline. Also, get a copy of Mike Kay's XSLT Programmer's 
Reference 2cnd edition (the bible for xsl).

> 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"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:template match="/">
>     <xsl:variable name="foo">[test]</xsl:variable>
>     <xsl:variable name="bar" select="/project/target$foo"/>

This might be a typo..................................^

I am not clear on what you are trying to do, but here are some ideas.

Are you trying to hold a string in this variable? If so, you need to put 
the string in quotes:

<xsl:variable name="bar" select="concat('/project/target/', $foo)"/>

Are you trying to access something like:

<project>
   <target>
    [test]
   </target>
</project>

then:

<xsl:variable name="bar" select="normalize-space(/project/target)"/>

Are you trying to build an XPath on the fly to access something like:


<project>
   <target>
    <test boo="something"/>
   </target>
</project>

then:

<xsl:variable
   name="bar"
   select="/project/target/*[local-name()=$foo]/@something"/>





>     <xsl:value-of select="$bar"/>
>   </xsl:template>
> </xsl:stylesheet>
> 
> 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)?

don't use a DTD for this.
> 
> Or would anyone know how to hammer xsl:variables into doing what I want?

don't know what you 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.

see above

best,
-Rob

> 
> Thanks a lot,
> mrc
> --
>      Mike Castle      dalgoda@ix.netcom.com      www.netcom.com/~dalgoda/
>     We are all of us living in the shadow of Manhattan.  -- Watchmen
> fatal ("You are in a maze of twisty compiler features, all different"); --
> gcc




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message