Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 6th, 2003, 04:27 AM
Registered User
 
Join Date: Jul 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT queries

hi! got a some questions about XSLT. thanks in advance people.

GIVEN:
<xsl:output omit-xml-declaration="no" encoding="utf-8" indent="no" media-type="text/xml"/>


1. Using XSLT, how do I prevent "empty" elements (elements not having data and not elements with EMPTY declaration) from converting to XML empty syntax?

INPUT:
<entry></entry>

OUTPUT:
<entry/>

DESIRED OUTPUT:
<entry></entry>


2. XSLT converts &apos; and &quot;. Is there a way for XSLT not to convert these two entities. XSLT retains &lt; &gt; and &amp;.

INPUT:
&lt; &gt; &amp; and&quot; stages&apos;

OUTPUT:
&lt; &gt; &amp; and" stages'

DESIRED OUTPUT:
&lt; &gt; &amp; and&quot; stages&apos;


3. I need to preserved certain markups in my XML file. For example, all data within <myTag>. <xsl:copy-of> is not working. How do I do it in XSLT?

INPUT:
<p>data data &hellip;<myTag>&auml;</myTag>&hellip; data data.</p>

OUTPUT:
<p>data data ...<myTag>ä</myTag>... data data.</p>

DESIRED OUTPUT:
<p>data data ...<myTag>&auml;</myTag>... data data.<p>


Again, thanks to everybody!
 
Old August 7th, 2003, 11:25 AM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rushman
Default

Hi Arvin!

Q#1: <xsl:copy-of> will not change <element></element> to <element/>. It appears like this in Explorer but look at the source. You'll see it is still <element></element>.

Q#2 and Q#3: The entities are resolved by the XML parser BEFORE your document is passed to the XSLT. I think you'll have to change things a little bit if you want to keep all the markup...

Hope it helped,

Luc

Dijkstra's law on Programming and Inertia:

If you don't know what your program is supposed to do, don't try to write it.





Similar Threads
Thread Thread Starter Forum Replies Last Post
General XSLT Questions in the XSLT Forum jminatel BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 0 March 31st, 2008 07:50 PM
Can XSLT read DTD/schema and Generate XSLT.. ROCXY XSLT 1 November 6th, 2006 09:39 AM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
Combining Queries or results from 2 queries Ford SQL Server 2000 24 November 7th, 2005 08:54 PM
Queries xzvi0r Access 5 September 8th, 2003 10:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.