[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: embedded php tags in xml

Subject: RE: embedded php tags in xml
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Mon, 5 Apr 2004 23:02:00 +0100
php in xml
A processing instruction in the stylesheet (that's the thing between <? and
?>) is not copied to the result document. To create a processing instruction
in the result document, you need to use <xsl:processing-instruction>

Michael Kay 

> -----Original Message-----
> From: Jeffrey Moss [mailto:jeff@xxxxxxxxxxxx] 
> Sent: 05 April 2004 21:07
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  embedded php tags in xml
> 
> I have a source document I am running through a stylesheet 
> that has this in
> it:
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <nbn:template xmlns:nbn="nbn:namespace"
> xmlns="http://www.w3.org/1999/xhtml">
> <DIV CLASS="content">
>  <?php
>    print 'Content ('.__FILE__.')';
>  ?>
> 
> This is the default action content template.
> 
> </DIV>
> </nbn:template>
> 
> 
> I have some default templates set up to handle items in the 
> xhtml and nbn
> namespaces, normally anything without a namespace is part of the xhtml
> namespace by default in my xsl stylesheet, and all nodes in 
> this namespace
> match a xhtml:* template.
> 
> -------
> When I run it through xsltproc with verbose debugging, it 
> spits this out:
> 
> xsltApplyTemplates: node: DIV
> xsltApplyTemplates: list of 3 nodes
> xsltProcessOneNode: no template found for text
> xsltDefaultProcessOneNode: copy text
> 
> xsltCopyText: copy text
> 
> xsltProcessOneNode: no template found for php
> xsltProcessOneNode: no template found for text
> xsltDefaultProcessOneNode: copy text
> 
> This is the default action content template.
> ----------
> 
> 
> Now it looks like everything with a ? falls into a different 
> namespace? Or
> is that some special instruction?
> Ideally I'd like this to just copy right over, as if it were 
> an ordinary
> XHTML tag.
> 
> Also, I was curious about embedding php code in my xsl stylesheets, I
> suppose I need to use [CDATA[ , if anybody is familiar with 
> this I would
> appreciate any input.
> 
> -Jeff Moss

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.