cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <gkossakow...@apache.org>
Subject Re: New expression language usage
Date Sun, 27 Jan 2008 23:53:35 GMT
Reinhard Poetz pisze:
> can you help me with following (simple) pipeline:
> 
> <map:pipeline>
>   <map:match pattern="matching/*">
>     <map:generate src="sax-pipeline/[???].xml"/>
>     <map:serialize type="xml"/>
>   </map:match>
> </map:pipeline>
> 
> What do I have to put instead of [???] if I want ro refer to the first
> match of
> the wildcard matcher?

Oh gosh, you stumbled upon COCOON-2118[1] issue. Fortunately enough, at least COCOON-2117
is
resolved so we can find this value in ObjectModel. Using XPath it should be something like:

  all/sitemap[position() = last()]/*[name()='1']

or:

  all/sitemap[position() = last()]/*[name()='$named$']/*[name()='1']

I don't remember if $named$ part is necessary. I must put here a BIG warning, I tested this
only
casually so this part of EL might have bugs.

Expressions above look quite nasty so I think we'll need to get map: language done pretty
quickly.
(I think it should be easy)

If you can't make this work, write a IT for it and I'll have a look ASAP.

> hmm, they work for me. Nontheless, you can always run a single test from
> within
> your IDE.

I get something like this:

testSettingStatusCode(org.apache.cocoon.micro.it.SaxPipelineTest)  Time elapsed: 0.037 sec
 <<< FAILURE!
junit.framework.ComparisonFailure: expected:<10[30]> but was:<10[24]>
	at junit.framework.Assert.assertEquals(Assert.java:81)
	at junit.framework.Assert.assertEquals(Assert.java:87)
	at org.apache.cocoon.micro.it.SaxPipelineTest.testSettingStatusCode(SaxPipelineTest.java:69)
	at org.apache.cocoon.micro.it.SaxPipelineTest.testSettingStatusCode(SaxPipelineTest.java:69)


> 
> they will be gone as soon as the spring-configurator and
> servlet-service-impl
> are released.

Right.

[1] https://issues.apache.org/jira/browse/COCOON-2118

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

Mime
View raw message