You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tim Anderson <tm...@netspace.net.au> on 2003/07/03 10:00:15 UTC

Replacing tags in xdocs

Hi,
    I would like to replace embedded tags within 
my xdocs, prior to them being transformed to html. 
Whats the recommended approach for doing this?
Its not clear to me which goal I need to hook in to. 
Alternatively, does anyone have a reference to a 
maven.xml which does this already?

Thanks,

Tim



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Replacing tags in xdocs

Posted by Cocell | Trygve Laugstøl <tr...@cocell.com>.
Tim, you need this the the root tag:

   <project xmlns:ant="jelly:ant">

to import the and namespace.

Trygve

Tim Pizey wrote:
> Tim, 
> 
> Didn't spot any replies, so I have tried this, 
> but I get:
> Fatal Error [line 7, row 35]: The prefix "ant" for element "ant:copy" is not 
> bound.
> org.xml.sax.SAXParseException: The prefix "ant" for element "ant:copy" is not 
> bound.
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at javax.xml.parsers.SAXParser.parse(Unknown Source)
> 
> Is this a good way to go?
> How do I cure the above?
> 
> I am slightly suprised to see 
> 
>   <properties>
>     <title>Maven</title>
>     <author email="jason@zenplex.com">Jason van Zyl</author>
>   </properties>
> 
> hardcoded into the maven xdocs, surely these should be coming from the pom?
> 
> any hints appreciated
> timp
> 
> 
> On Friday 04 July 2003 5:41 am, Tim Anderson wrote:
> 
>>Worked out a way to do it, but its not pretty, e.g:
>>
>>  <preGoal name="xdoc:transform">
>>    <ant:mkdir dir="${maven.docs.src}"/>
>>    <ant:copy todir="${maven.docs.src}">
>>      <ant:fileset dir="${xdoc.dir}">
>>        <ant:include name="**/*.xml"/>
>>      </ant:fileset>
>>      <ant:filterset>
>>        <ant:filter token="VERSION" value="${pom.currentVersion}"/>
>>      </ant:filterset>
>>    </ant:copy>
>>    <ant:copy todir="${maven.docs.src}">
>>      <ant:fileset dir="${xdoc.dir}">
>>        <ant:include name="**/*"/>
>>        <ant:exclude name="**/*.xml"/>
>>      </ant:fileset>
>>    </ant:copy>
>>  </preGoal>
>>
>>I can't see a simpler way - anyone got any better ideas?
>>
>>Thanks,
>>
>>Tim
>>
>>
>>>-----Original Message-----
>>>From: Tim Anderson [mailto:tma@netspace.net.au]
>>>Sent: Thursday, 3 July 2003 6:00 PM
>>>To: Maven Users List
>>>Subject: Replacing tags in xdocs
>>>
>>>
>>>Hi,
>>>    I would like to replace embedded tags within
>>>my xdocs, prior to them being transformed to html.
>>>Whats the recommended approach for doing this?
>>>Its not clear to me which goal I need to hook in to.
>>>Alternatively, does anyone have a reference to a
>>>maven.xml which does this already?
>>>
>>>Thanks,
>>>
>>>Tim
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Replacing tags in xdocs

Posted by Tim Pizey <ti...@paneris.org>.
On Wednesday 09 July 2003 1:50 pm, Jason van Zyl wrote:
> On Wed, 2003-07-09 at 10:40, Tim Pizey wrote:
> >
> > I am slightly suprised to see
> >
> >   <properties>
> >     <title>Maven</title>
> >     <author email="jason@zenplex.com">Jason van Zyl</author>
> >   </properties>
> >
> > hardcoded into the maven xdocs, surely these should be coming from the
> > pom?
>
> Hardcoded in what xdocs? In Maven's own xdocs?

Yes, maven/xdocs/index.xml for example.

I can see, now, that the author tag should be there, but it would be nice to 
have pom.name instead of Maven in the title, as many of my xdocs will be the 
same on all my projects.

cheers
timp

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Replacing tags in xdocs

Posted by Jason van Zyl <ja...@zenplex.com>.
On Wed, 2003-07-09 at 10:40, Tim Pizey wrote:
> Tim, 
> 
> Didn't spot any replies, so I have tried this, 
> but I get:
> Fatal Error [line 7, row 35]: The prefix "ant" for element "ant:copy" is not 
> bound.
> org.xml.sax.SAXParseException: The prefix "ant" for element "ant:copy" is not 
> bound.
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at javax.xml.parsers.SAXParser.parse(Unknown Source)
> 
> Is this a good way to go?
> How do I cure the above?
> 
> I am slightly suprised to see 
> 
>   <properties>
>     <title>Maven</title>
>     <author email="jason@zenplex.com">Jason van Zyl</author>
>   </properties>
> 
> hardcoded into the maven xdocs, surely these should be coming from the pom?

Hardcoded in what xdocs? In Maven's own xdocs?

> any hints appreciated
> timp
> 
> 
> On Friday 04 July 2003 5:41 am, Tim Anderson wrote:
> > Worked out a way to do it, but its not pretty, e.g:
> >
> >   <preGoal name="xdoc:transform">
> >     <ant:mkdir dir="${maven.docs.src}"/>
> >     <ant:copy todir="${maven.docs.src}">
> >       <ant:fileset dir="${xdoc.dir}">
> >         <ant:include name="**/*.xml"/>
> >       </ant:fileset>
> >       <ant:filterset>
> >         <ant:filter token="VERSION" value="${pom.currentVersion}"/>
> >       </ant:filterset>
> >     </ant:copy>
> >     <ant:copy todir="${maven.docs.src}">
> >       <ant:fileset dir="${xdoc.dir}">
> >         <ant:include name="**/*"/>
> >         <ant:exclude name="**/*.xml"/>
> >       </ant:fileset>
> >     </ant:copy>
> >   </preGoal>
> >
> > I can't see a simpler way - anyone got any better ideas?
> >
> > Thanks,
> >
> > Tim
> >
> > > -----Original Message-----
> > > From: Tim Anderson [mailto:tma@netspace.net.au]
> > > Sent: Thursday, 3 July 2003 6:00 PM
> > > To: Maven Users List
> > > Subject: Replacing tags in xdocs
> > >
> > >
> > > Hi,
> > >     I would like to replace embedded tags within
> > > my xdocs, prior to them being transformed to html.
> > > Whats the recommended approach for doing this?
> > > Its not clear to me which goal I need to hook in to.
> > > Alternatively, does anyone have a reference to a
> > > maven.xml which does this already?
> > >
> > > Thanks,
> > >
> > > Tim
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
-- 
jvz.

Jason van Zyl
jason@zenplex.com
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Replacing tags in xdocs

Posted by Tim Anderson <tm...@netspace.net.au>.
See comments inline.

> -----Original Message-----
> From: Tim Pizey [mailto:timp@paneris.org]
> Sent: Thursday, 10 July 2003 12:41 AM
> To: Maven Users List
> Subject: Re: Replacing tags in xdocs
> 
> 
> Tim, 
> 
> Didn't spot any replies, so I have tried this, 
> but I get:
> Fatal Error [line 7, row 35]: The prefix "ant" for element 
> "ant:copy" is not 
> bound.
> org.xml.sax.SAXParseException: The prefix "ant" for element 
> "ant:copy" is not 
> bound.
>         at 
> org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at javax.xml.parsers.SAXParser.parse(Unknown Source)
> 
> Is this a good way to go?
> How do I cure the above?

In maven.xml you need to specify the ant namespace i.e:
<project default="jar:jar"
         xmlns:ant="jelly:ant" 
   ....

The example also requires a couple of definitions in project.properties:

# contains the source docs
xdoc.dir=${basedir}/xdocs 

# contains the docs with tags replaced
maven.docs.src = ${maven.build.dir}/xdocs 

> 
> I am slightly suprised to see 
> 
>   <properties>
>     <title>Maven</title>
>     <author email="jason@zenplex.com">Jason van Zyl</author>
>   </properties>
> 
> hardcoded into the maven xdocs, surely these should be coming 
> from the pom?

Nope - think of them as being like the @author tags in java sources.

> 
> any hints appreciated
> timp
> 
> 
> On Friday 04 July 2003 5:41 am, Tim Anderson wrote:
> > Worked out a way to do it, but its not pretty, e.g:
> >
> >   <preGoal name="xdoc:transform">
> >     <ant:mkdir dir="${maven.docs.src}"/>
> >     <ant:copy todir="${maven.docs.src}">
> >       <ant:fileset dir="${xdoc.dir}">
> >         <ant:include name="**/*.xml"/>
> >       </ant:fileset>
> >       <ant:filterset>
> >         <ant:filter token="VERSION" value="${pom.currentVersion}"/>
> >       </ant:filterset>
> >     </ant:copy>
> >     <ant:copy todir="${maven.docs.src}">
> >       <ant:fileset dir="${xdoc.dir}">
> >         <ant:include name="**/*"/>
> >         <ant:exclude name="**/*.xml"/>
> >       </ant:fileset>
> >     </ant:copy>
> >   </preGoal>
> >
> > I can't see a simpler way - anyone got any better ideas?
> >
> > Thanks,
> >
> > Tim
> >
> > > -----Original Message-----
> > > From: Tim Anderson [mailto:tma@netspace.net.au]
> > > Sent: Thursday, 3 July 2003 6:00 PM
> > > To: Maven Users List
> > > Subject: Replacing tags in xdocs
> > >
> > >
> > > Hi,
> > >     I would like to replace embedded tags within
> > > my xdocs, prior to them being transformed to html.
> > > Whats the recommended approach for doing this?
> > > Its not clear to me which goal I need to hook in to.
> > > Alternatively, does anyone have a reference to a
> > > maven.xml which does this already?
> > >
> > > Thanks,
> > >
> > > Tim
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Replacing tags in xdocs

Posted by Tim Pizey <ti...@paneris.org>.
Tim, 

Didn't spot any replies, so I have tried this, 
but I get:
Fatal Error [line 7, row 35]: The prefix "ant" for element "ant:copy" is not 
bound.
org.xml.sax.SAXParseException: The prefix "ant" for element "ant:copy" is not 
bound.
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(Unknown Source)

Is this a good way to go?
How do I cure the above?

I am slightly suprised to see 

  <properties>
    <title>Maven</title>
    <author email="jason@zenplex.com">Jason van Zyl</author>
  </properties>

hardcoded into the maven xdocs, surely these should be coming from the pom?

any hints appreciated
timp


On Friday 04 July 2003 5:41 am, Tim Anderson wrote:
> Worked out a way to do it, but its not pretty, e.g:
>
>   <preGoal name="xdoc:transform">
>     <ant:mkdir dir="${maven.docs.src}"/>
>     <ant:copy todir="${maven.docs.src}">
>       <ant:fileset dir="${xdoc.dir}">
>         <ant:include name="**/*.xml"/>
>       </ant:fileset>
>       <ant:filterset>
>         <ant:filter token="VERSION" value="${pom.currentVersion}"/>
>       </ant:filterset>
>     </ant:copy>
>     <ant:copy todir="${maven.docs.src}">
>       <ant:fileset dir="${xdoc.dir}">
>         <ant:include name="**/*"/>
>         <ant:exclude name="**/*.xml"/>
>       </ant:fileset>
>     </ant:copy>
>   </preGoal>
>
> I can't see a simpler way - anyone got any better ideas?
>
> Thanks,
>
> Tim
>
> > -----Original Message-----
> > From: Tim Anderson [mailto:tma@netspace.net.au]
> > Sent: Thursday, 3 July 2003 6:00 PM
> > To: Maven Users List
> > Subject: Replacing tags in xdocs
> >
> >
> > Hi,
> >     I would like to replace embedded tags within
> > my xdocs, prior to them being transformed to html.
> > Whats the recommended approach for doing this?
> > Its not clear to me which goal I need to hook in to.
> > Alternatively, does anyone have a reference to a
> > maven.xml which does this already?
> >
> > Thanks,
> >
> > Tim


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Replacing tags in xdocs

Posted by Tim Anderson <tm...@netspace.net.au>.
Worked out a way to do it, but its not pretty, e.g:

  <preGoal name="xdoc:transform">
    <ant:mkdir dir="${maven.docs.src}"/>
    <ant:copy todir="${maven.docs.src}">
      <ant:fileset dir="${xdoc.dir}">
        <ant:include name="**/*.xml"/>
      </ant:fileset>
      <ant:filterset>
        <ant:filter token="VERSION" value="${pom.currentVersion}"/>
      </ant:filterset>
    </ant:copy>
    <ant:copy todir="${maven.docs.src}">
      <ant:fileset dir="${xdoc.dir}">
        <ant:include name="**/*"/>
        <ant:exclude name="**/*.xml"/>
      </ant:fileset>
    </ant:copy>
  </preGoal>

I can't see a simpler way - anyone got any better ideas?

Thanks,

Tim

> -----Original Message-----
> From: Tim Anderson [mailto:tma@netspace.net.au]
> Sent: Thursday, 3 July 2003 6:00 PM
> To: Maven Users List
> Subject: Replacing tags in xdocs
> 
> 
> Hi,
>     I would like to replace embedded tags within 
> my xdocs, prior to them being transformed to html. 
> Whats the recommended approach for doing this?
> Its not clear to me which goal I need to hook in to. 
> Alternatively, does anyone have a reference to a 
> maven.xml which does this already?
> 
> Thanks,
> 
> Tim
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org