You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Sayre <ri...@gmail.com> on 2007/08/14 16:18:08 UTC

XSLT Result matching pattern

I am new to regular expressions and I am trying to have my XSLT result
only show certain elements that are in the XML.


here is some if the XML:

<result>
 <actionsErrors/>
 <actionsMessages/>
 <questionTree> ... </questionTree>
<user> ... </user>
<session> ... </session>

</result>

I only want the result/questionTree node to be return to my page.

I tried doing this:

<param name="matchingPattern">/result/questionTree</param>

But all the XML is still returned.  Am I using that parameter
properly?  Does it filter what XML is returned?  If so is my pattern
wrong?

Thank you,

Rich

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


RE: XSLT Result matching pattern

Posted by John Krueger <jk...@pathfire.com>.
You may also be able to use the exposedValue param in the result to get
the xml output that you are looking for.

<param name="exposedValue">questionTree</param>

John

> -----Original Message-----
> From: John Krueger [mailto:jkrueger@pathfire.com] 
> Sent: Thursday, August 16, 2007 12:16 PM
> To: Struts Users Mailing List
> Subject: RE: XSLT Result matching pattern
> 
> There is an open issue for struts2 with the matchingPattern and
> excludingPattern
> params for the xslt result type.
> 
> https://issues.apache.org/struts/browse/WW-1550 
> 
> Other options/workarounds for this would be to change the 
> accessibility
> of your
> getUser and getSession methods to something other than 
> public.  This is
> definitely
> not ideal and may or may not be possible depending on your app.  Since
> it looks like
> your are also extending ActionSupport, I don't know of a way 
> to stop the
> generation
> of the actionErrors and actionMessages xml fragments.
> 
> 
> John
> 
> > -----Original Message-----
> > From: Richard Sayre [mailto:richardsayre@gmail.com] 
> > Sent: Tuesday, August 14, 2007 10:18 AM
> > To: Struts Users Mailing List
> > Subject: XSLT Result matching pattern
> > 
> > I am new to regular expressions and I am trying to have my 
> XSLT result
> > only show certain elements that are in the XML.
> > 
> > 
> > here is some if the XML:
> > 
> > <result>
> >  <actionsErrors/>
> >  <actionsMessages/>
> >  <questionTree> ... </questionTree>
> > <user> ... </user>
> > <session> ... </session>
> > 
> > </result>
> > 
> > I only want the result/questionTree node to be return to my page.
> > 
> > I tried doing this:
> > 
> > <param name="matchingPattern">/result/questionTree</param>
> > 
> > But all the XML is still returned.  Am I using that parameter
> > properly?  Does it filter what XML is returned?  If so is my pattern
> > wrong?
> > 
> > Thank you,
> > 
> > Rich
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

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


RE: XSLT Result matching pattern

Posted by John Krueger <jk...@pathfire.com>.
There is an open issue for struts2 with the matchingPattern and
excludingPattern
params for the xslt result type.

https://issues.apache.org/struts/browse/WW-1550 

Other options/workarounds for this would be to change the accessibility
of your
getUser and getSession methods to something other than public.  This is
definitely
not ideal and may or may not be possible depending on your app.  Since
it looks like
your are also extending ActionSupport, I don't know of a way to stop the
generation
of the actionErrors and actionMessages xml fragments.


John

> -----Original Message-----
> From: Richard Sayre [mailto:richardsayre@gmail.com] 
> Sent: Tuesday, August 14, 2007 10:18 AM
> To: Struts Users Mailing List
> Subject: XSLT Result matching pattern
> 
> I am new to regular expressions and I am trying to have my XSLT result
> only show certain elements that are in the XML.
> 
> 
> here is some if the XML:
> 
> <result>
>  <actionsErrors/>
>  <actionsMessages/>
>  <questionTree> ... </questionTree>
> <user> ... </user>
> <session> ... </session>
> 
> </result>
> 
> I only want the result/questionTree node to be return to my page.
> 
> I tried doing this:
> 
> <param name="matchingPattern">/result/questionTree</param>
> 
> But all the XML is still returned.  Am I using that parameter
> properly?  Does it filter what XML is returned?  If so is my pattern
> wrong?
> 
> Thank you,
> 
> Rich
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

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