Re: Newbie question about XSP and XSLT

2005-05-11 Thread Derek Hohls
Xoan

This is geting more tricky, as its not clear from what you
say exactly what output you are expecting, and what tags
you want to keep and which you want to drop...

For example, you could use:

xsl:template match=xmlcode/reportId
 bxsl:apply-templates//b
/xsl:template

if you did not want to keep the reportId wrapper.
The reportIds that are not inside of xmlcode
should pass through as normal.

BTW, there is an XSL mailing list you can subscribe to...
and the experts there are also very friendly and helpful 
(not to mention much wiser!)

Regards
Derek


 [EMAIL PROTECTED] 2005/05/10 05:44:11 PM 
Hi Derek,

I don't want to be annoying but if you could help me again I would be
grateful.

I have slightly modified the xsl you sent me. The reason was for not
to replace the element but only to format it (copy-of):

!-- your node --
xsl:template match=xmlcode
 bxsl:copy-of select=.//b
/xsl:template

It works correctly, but actually, my intention is to apply the format
not to the xmlcode element, but another elements inside it. Moreover
I only want to apply this format to the reportId elemnts inside
xmlcode. It is possible the existence of reportId elements outside
xmlcode, and I don't want to format them.:

xmlcode
reportId1/reportId
/xmlcode


I've tried with:

!-- your node --
xsl:template match=//xmlcode/reportId
 bxsl:copy-of select=.//b
/xsl:template

but it seems not to work. 
Is this the right approach??? Which is my mistake??

Thanks a lot,

Xoan

2005/5/10, Xoan [EMAIL PROTECTED]:
 Thanks Derek,
 
 It works fine!
 
 Regards,
 
 Xoan
 
 2005/5/10, Derek Hohls [EMAIL PROTECTED]:
  Xoan
 
  Not too hard
 
  ?xml version=1.0?
  xsl:stylesheet version=1.0
  xmlns:xsl=http://www.w3.org/1999/XSL/Transform;

 
  !-- root --
  xsl:template match=/
xsl:apply-templates/
  /xsl:template
 
  !-- your node --
  xsl:template match=xmlcode
bxsl:apply-templates//b
  /xsl:template
 
  !-- others; leave as they are --
  xsl:template match=@*|node() priority=-1
xsl:copy
  xsl:apply-templates select=@*|node()/
/xsl:copy
  /xsl:template
 
  /xsl:stylesheet
 
  HTH
  Derek
 
   [EMAIL PROTECTED] 2005/05/10 02:10:25 PM 
  Hi all,
 
  I apologize for the obvious question. Perhaps this is not the
right
  place to present it.
 
  I am using Cocoon and XSP to query eXist (native xml database).I
have
  a xsp that performs a query on eXist using the following code:
 
  
  xsp:page language=javascript xmlns:xsp=http://apache.org/xsp;
  xmlns:xdb=http://exist-db.org/xmldb/1.0;
  xmlns:xsp-request=http://apache.org/xsp/request/2.0;
  xmlns:util=http://apache.org/xsp/util/v1;
 
  html xmlns=http://www.w3.org/1999/xhtml;
  head
  ...
  ...
  xmlcode
  xsp:contentxdb:get-xml as=xml//xsp:content
  /xmlcode
 
  ...
  ...
  /body
  /html
 
  /xsp:page
  
 
  I need to perform some simple format (like bold or italics) on the
  element xmlcode. The rest of the page must remain equal.
  I am trying to pass a xsl to it.  In my sitemap:
 
  map:match pattern=**.xsp
  map:generate src={1}.xsp
  type=serverpages/
  map:transform
src=SomeFormat.xsl/
  map:serialize
  type=html/
  /map:match
 
  How could I perform this format leaving the rest of the document
  without changes??
  Any xsl example similar to this on blocks?
 
  Thanks in advance
 
  Xoan
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED] 
  For additional commands, e-mail: [EMAIL PROTECTED] 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED] 
  For additional commands, e-mail: [EMAIL PROTECTED] 
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie question about XSP and XSLT

2005-05-11 Thread Xoan
Thanks to all for the info,

I've solved the problem.

Regards
Xoan

2005/5/11, Derek Hohls [EMAIL PROTECTED]:
 Xoan
 
 This is geting more tricky, as its not clear from what you
 say exactly what output you are expecting, and what tags
 you want to keep and which you want to drop...
 
 For example, you could use:
 
 xsl:template match=xmlcode/reportId
  bxsl:apply-templates//b
 /xsl:template
 
 if you did not want to keep the reportId wrapper.
 The reportIds that are not inside of xmlcode
 should pass through as normal.
 
 BTW, there is an XSL mailing list you can subscribe to...
 and the experts there are also very friendly and helpful
 (not to mention much wiser!)
 
 Regards
 Derek
 
  [EMAIL PROTECTED] 2005/05/10 05:44:11 PM 
 Hi Derek,
 
 I don't want to be annoying but if you could help me again I would be
 grateful.
 
 I have slightly modified the xsl you sent me. The reason was for not
 to replace the element but only to format it (copy-of):
 
 !-- your node --
 xsl:template match=xmlcode
  bxsl:copy-of select=.//b
 /xsl:template
 
 It works correctly, but actually, my intention is to apply the format
 not to the xmlcode element, but another elements inside it. Moreover
 I only want to apply this format to the reportId elemnts inside
 xmlcode. It is possible the existence of reportId elements outside
 xmlcode, and I don't want to format them.:
 
 xmlcode
 reportId1/reportId
 /xmlcode
 
 I've tried with:
 
 !-- your node --
 xsl:template match=//xmlcode/reportId
  bxsl:copy-of select=.//b
 /xsl:template
 
 but it seems not to work.
 Is this the right approach??? Which is my mistake??
 
 Thanks a lot,
 
 Xoan
 
 2005/5/10, Xoan [EMAIL PROTECTED]:
  Thanks Derek,
 
  It works fine!
 
  Regards,
 
  Xoan
 
  2005/5/10, Derek Hohls [EMAIL PROTECTED]:
   Xoan
  
   Not too hard
  
   ?xml version=1.0?
   xsl:stylesheet version=1.0
   xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 
  
   !-- root --
   xsl:template match=/
 xsl:apply-templates/
   /xsl:template
  
   !-- your node --
   xsl:template match=xmlcode
 bxsl:apply-templates//b
   /xsl:template
  
   !-- others; leave as they are --
   xsl:template match=@*|node() priority=-1
 xsl:copy
   xsl:apply-templates select=@*|node()/
 /xsl:copy
   /xsl:template
  
   /xsl:stylesheet
  
   HTH
   Derek
  
[EMAIL PROTECTED] 2005/05/10 02:10:25 PM 
   Hi all,
  
   I apologize for the obvious question. Perhaps this is not the
 right
   place to present it.
  
   I am using Cocoon and XSP to query eXist (native xml database).I
 have
   a xsp that performs a query on eXist using the following code:
  
   
   xsp:page language=javascript xmlns:xsp=http://apache.org/xsp;
   xmlns:xdb=http://exist-db.org/xmldb/1.0;
   xmlns:xsp-request=http://apache.org/xsp/request/2.0;
   xmlns:util=http://apache.org/xsp/util/v1;
  
   html xmlns=http://www.w3.org/1999/xhtml;
   head
   ...
   ...
   xmlcode
   xsp:contentxdb:get-xml as=xml//xsp:content
   /xmlcode
  
   ...
   ...
   /body
   /html
  
   /xsp:page
   
  
   I need to perform some simple format (like bold or italics) on the
   element xmlcode. The rest of the page must remain equal.
   I am trying to pass a xsl to it.  In my sitemap:
  
   map:match pattern=**.xsp
   map:generate src={1}.xsp
   type=serverpages/
   map:transform
 src=SomeFormat.xsl/
   map:serialize
   type=html/
   /map:match
  
   How could I perform this format leaving the rest of the document
   without changes??
   Any xsl example similar to this on blocks?
  
   Thanks in advance
  
   Xoan
  
  
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Newbie question about XSP and XSLT

2005-05-10 Thread Xoan
Hi all,

I apologize for the obvious question. Perhaps this is not the right
place to present it.

I am using Cocoon and XSP to query eXist (native xml database).I have
a xsp that performs a query on eXist using the following code:


xsp:page language=javascript xmlns:xsp=http://apache.org/xsp; 
xmlns:xdb=http://exist-db.org/xmldb/1.0; 
xmlns:xsp-request=http://apache.org/xsp/request/2.0;
xmlns:util=http://apache.org/xsp/util/v1;

html xmlns=http://www.w3.org/1999/xhtml;
head
...
...
xmlcode
xsp:contentxdb:get-xml as=xml//xsp:content
/xmlcode

...
...
/body
/html

/xsp:page


I need to perform some simple format (like bold or italics) on the
element xmlcode. The rest of the page must remain equal.
I am trying to pass a xsl to it.  In my sitemap:

map:match pattern=**.xsp
map:generate src={1}.xsp type=serverpages/
map:transform src=SomeFormat.xsl/
map:serialize  type=html/   

/map:match


How could I perform this format leaving the rest of the document
without changes??
Any xsl example similar to this on blocks?

Thanks in advance

Xoan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie question about XSP and XSLT

2005-05-10 Thread Derek Hohls
Xoan

Not too hard


?xml version=1.0?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
  

!-- root --
xsl:template match=/
  xsl:apply-templates/
/xsl:template

!-- your node --
xsl:template match=xmlcode
  bxsl:apply-templates//b
/xsl:template

!-- others; leave as they are --
xsl:template match=@*|node() priority=-1
  xsl:copy
xsl:apply-templates select=@*|node()/
  /xsl:copy
/xsl:template

/xsl:stylesheet


HTH
Derek

 [EMAIL PROTECTED] 2005/05/10 02:10:25 PM 
Hi all,

I apologize for the obvious question. Perhaps this is not the right
place to present it.

I am using Cocoon and XSP to query eXist (native xml database).I have
a xsp that performs a query on eXist using the following code:


xsp:page language=javascript xmlns:xsp=http://apache.org/xsp; 
xmlns:xdb=http://exist-db.org/xmldb/1.0; 
xmlns:xsp-request=http://apache.org/xsp/request/2.0;
xmlns:util=http://apache.org/xsp/util/v1;

html xmlns=http://www.w3.org/1999/xhtml;
head
...
...
xmlcode
xsp:contentxdb:get-xml as=xml//xsp:content
/xmlcode

...
...
/body
/html

/xsp:page


I need to perform some simple format (like bold or italics) on the
element xmlcode. The rest of the page must remain equal.
I am trying to pass a xsl to it.  In my sitemap:

map:match pattern=**.xsp
map:generate src={1}.xsp
type=serverpages/
map:transform src=SomeFormat.xsl/
map:serialize 
type=html/   
/map:match


How could I perform this format leaving the rest of the document
without changes??
Any xsl example similar to this on blocks?

Thanks in advance

Xoan

-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie question about XSP and XSLT

2005-05-10 Thread Xoan
Thanks Derek,

It works fine!

Regards,

Xoan

2005/5/10, Derek Hohls [EMAIL PROTECTED]:
 Xoan
 
 Not too hard
 
 ?xml version=1.0?
 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
   
 
 !-- root --
 xsl:template match=/
   xsl:apply-templates/
 /xsl:template
 
 !-- your node --
 xsl:template match=xmlcode
   bxsl:apply-templates//b
 /xsl:template
 
 !-- others; leave as they are --
 xsl:template match=@*|node() priority=-1
   xsl:copy
 xsl:apply-templates select=@*|node()/
   /xsl:copy
 /xsl:template
 
 /xsl:stylesheet
 
 HTH
 Derek
 
  [EMAIL PROTECTED] 2005/05/10 02:10:25 PM 
 Hi all,
 
 I apologize for the obvious question. Perhaps this is not the right
 place to present it.
 
 I am using Cocoon and XSP to query eXist (native xml database).I have
 a xsp that performs a query on eXist using the following code:
 
 
 xsp:page language=javascript xmlns:xsp=http://apache.org/xsp;
 xmlns:xdb=http://exist-db.org/xmldb/1.0;
 xmlns:xsp-request=http://apache.org/xsp/request/2.0;
 xmlns:util=http://apache.org/xsp/util/v1;
 
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 ...
 ...
 xmlcode
 xsp:contentxdb:get-xml as=xml//xsp:content
 /xmlcode
 
 ...
 ...
 /body
 /html
 
 /xsp:page
 
 
 I need to perform some simple format (like bold or italics) on the
 element xmlcode. The rest of the page must remain equal.
 I am trying to pass a xsl to it.  In my sitemap:
 
 map:match pattern=**.xsp
 map:generate src={1}.xsp
 type=serverpages/
 map:transform src=SomeFormat.xsl/
 map:serialize
 type=html/
 /map:match
 
 How could I perform this format leaving the rest of the document
 without changes??
 Any xsl example similar to this on blocks?
 
 Thanks in advance
 
 Xoan
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie question about XSP and XSLT

2005-05-10 Thread Xoan
Hi Derek,

I don't want to be annoying but if you could help me again I would be grateful.

I have slightly modified the xsl you sent me. The reason was for not
to replace the element but only to format it (copy-of):

!-- your node --
xsl:template match=xmlcode
 bxsl:copy-of select=.//b
/xsl:template

It works correctly, but actually, my intention is to apply the format
not to the xmlcode element, but another elements inside it. Moreover
I only want to apply this format to the reportId elemnts inside
xmlcode. It is possible the existence of reportId elements outside
xmlcode, and I don't want to format them.:

xmlcode
reportId1/reportId
/xmlcode


I've tried with:

!-- your node --
xsl:template match=//xmlcode/reportId
 bxsl:copy-of select=.//b
/xsl:template

but it seems not to work. 
Is this the right approach??? Which is my mistake??

Thanks a lot,

Xoan

2005/5/10, Xoan [EMAIL PROTECTED]:
 Thanks Derek,
 
 It works fine!
 
 Regards,
 
 Xoan
 
 2005/5/10, Derek Hohls [EMAIL PROTECTED]:
  Xoan
 
  Not too hard
 
  ?xml version=1.0?
  xsl:stylesheet version=1.0
  xmlns:xsl=http://www.w3.org/1999/XSL/Transform;

 
  !-- root --
  xsl:template match=/
xsl:apply-templates/
  /xsl:template
 
  !-- your node --
  xsl:template match=xmlcode
bxsl:apply-templates//b
  /xsl:template
 
  !-- others; leave as they are --
  xsl:template match=@*|node() priority=-1
xsl:copy
  xsl:apply-templates select=@*|node()/
/xsl:copy
  /xsl:template
 
  /xsl:stylesheet
 
  HTH
  Derek
 
   [EMAIL PROTECTED] 2005/05/10 02:10:25 PM 
  Hi all,
 
  I apologize for the obvious question. Perhaps this is not the right
  place to present it.
 
  I am using Cocoon and XSP to query eXist (native xml database).I have
  a xsp that performs a query on eXist using the following code:
 
  
  xsp:page language=javascript xmlns:xsp=http://apache.org/xsp;
  xmlns:xdb=http://exist-db.org/xmldb/1.0;
  xmlns:xsp-request=http://apache.org/xsp/request/2.0;
  xmlns:util=http://apache.org/xsp/util/v1;
 
  html xmlns=http://www.w3.org/1999/xhtml;
  head
  ...
  ...
  xmlcode
  xsp:contentxdb:get-xml as=xml//xsp:content
  /xmlcode
 
  ...
  ...
  /body
  /html
 
  /xsp:page
  
 
  I need to perform some simple format (like bold or italics) on the
  element xmlcode. The rest of the page must remain equal.
  I am trying to pass a xsl to it.  In my sitemap:
 
  map:match pattern=**.xsp
  map:generate src={1}.xsp
  type=serverpages/
  map:transform src=SomeFormat.xsl/
  map:serialize
  type=html/
  /map:match
 
  How could I perform this format leaving the rest of the document
  without changes??
  Any xsl example similar to this on blocks?
 
  Thanks in advance
 
  Xoan
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie question about XSP and XSLT

2005-05-10 Thread [EMAIL PROTECTED]
Xoan wrote:
[...]
It works correctly, but actually, my intention is to apply the format
not to the xmlcode element, but another elements inside it. Moreover
I only want to apply this format to the reportId elemnts inside
xmlcode. It is possible the existence of reportId elements outside
xmlcode, and I don't want to format them.:
xmlcode
reportId1/reportId
/xmlcode
I've tried with:
!-- your node --
xsl:template match=//xmlcode/reportId
 bxsl:copy-of select=.//b
/xsl:template
but it seems not to work. 
[...]
Then try
xsl:template match=//xmlcode/reportId
  xsl:copy
b
  xsl:apply-templates select=@*|node()/
/b
  /xsl:copy
/xsl:template

--
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]