473,473 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Mixed content handling

I have an XML file with mixed content like this:

<sometag>

some text...
some text...

<anothertag>
other text...
other text...
</anothertag>

some more text...
</sometag>

I have a stylesheet which processes <sometag>, which
in turn processes <anothertag>.

My problem is that my stylesheet will skip the text after
"</anothertag>. Is there a way to do this?
Per

Sep 14 '05 #1
5 1143
mr************@gmail.com wrote:
I have an XML file with mixed content like this:

<sometag>

some text...
some text...

<anothertag>
other text...
other text...
</anothertag>

some more text...
</sometag>

I have a stylesheet which processes <sometag>, which
in turn processes <anothertag>.

My problem is that my stylesheet will skip the text after
"</anothertag>. Is there a way to do this?


Without seeing what your XSL says, it's not possible to answer.

But at a wild guess, you're not using <xsl:apply-templates/> in the
template which handles <sometag>.

///Peter
Sep 14 '05 #2
Sorry about that, here is a snippet:

--------------------------------------------------------------------------
<xsl:template match="sometag">
<xsl:value-of select="text()"/>
<xsl:apply-templates select="anothertag"/>
</xsl:template>

<xsl:template match="anothertag">
<xsl:value-of select="text()"/>
<xsl:apply-templates select="anothertag"/>
</xsl:template>

--------------------------------------------------

Per

Sep 14 '05 #3
Tempore 00:02:57, die Thursday 15 September 2005 AD, hinc in foro {comp.text.xml} scripsit Pejb <mr************@gmail.com>:
<xsl:template match="sometag">
<xsl:value-of select="text()"/>
<xsl:apply-templates select="anothertag"/>
</xsl:template>

<xsl:template match="anothertag">
<xsl:value-of select="text()"/>
<xsl:apply-templates select="anothertag"/>
</xsl:template>

--------------------------------------------------


Change that to:
<xsl:template match="sometag">
<xsl:apply-templates select="anothertag|text()"/>
</xsl:template>

<xsl:template match="anothertag">
<xsl:apply-templates select="anothertag|text()"/>
</xsl:template>


regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Fiat W3C in tenebris
Sep 15 '05 #4
Pejb wrote:
Sorry about that, here is a snippet:

--------------------------------------------------------------------------
<xsl:template match="sometag">
<xsl:value-of select="text()"/>
<xsl:apply-templates select="anothertag"/>
</xsl:template>

<xsl:template match="anothertag">
<xsl:value-of select="text()"/>
<xsl:apply-templates select="anothertag"/>
</xsl:template>


If you want everything output that should be

<xsl:template match="sometag">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="anothertag">
<xsl:apply-templates/>
</xsl:template>

///Peter

Sep 16 '05 #5

Peter Flynn wrote:
Pejb wrote:
Sorry about that, here is a snippet:

--------------------------------------------------------------------------
<xsl:template match="sometag">
<xsl:value-of select="text()"/>
<xsl:apply-templates select="anothertag"/>
</xsl:template>

<xsl:template match="anothertag">
<xsl:value-of select="text()"/>
<xsl:apply-templates select="anothertag"/>
</xsl:template>


If you want everything output that should be

<xsl:template match="sometag">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="anothertag">
<xsl:apply-templates/>
</xsl:template>

///Peter


Thanks!
This works perfectly now.

Per

Sep 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Swaroop Kumar | last post by:
Hi: I'm trying to write a schema that contains information as described below: 1. The first element is a mandatory fixed string. 2. The second element is a mixed content element that can...
0
by: Imiro | last post by:
Hi, i'm trying to express mixed content like this with a schema: <root>string<tag1/></root> or <root>string</root> but not <root></root> I guess it would be like this as dtd declaration...
0
by: Fender Mussel | last post by:
Hi all, Is it possible to check the content of a mixed type? I would like to define an enumeration for it. The following example works syntactically, but XMLSpy does no checks on the content at...
15
by: Bill Cohagan | last post by:
I'm trying to generate class definitions from an XSD that contains something like: <xs:complexType name="foo" mixed="true"> <xs:choice minOccurs = "0" maxOccurs="unbounded"> <xs:element name =...
1
by: Anas M. Nebuchadnezzar XXXVII | last post by:
I have an Xml file that I am trying to transform using an Xsl stylesheet. My data is in the form of: <root> ... <aaa> <bbb>Mixed content type, with <def link="words">words</def> defined in...
0
by: Werner Maier | last post by:
Hi please can anybody help me to read a WEB side with Content-Type: multipart/x-mixed-replace ("Server Push") . I am a absolutly newbie with c# .net. i have problems to read the boundarys to...
3
by: Nadav | last post by:
Hi, I am writing a mixed mode application, I have a mixed mode Assembly manipulating a managed byte array, to access this array in unmanaged code I '__pin' the array, As I understand, pining an...
0
by: Garrek | last post by:
I have an existing ASP.Net application that must be modified to support mixed content: Latin-based languages (i.e. English) intermixed with Arabic. Our code and database assumes everything is...
1
by: andrew_nuss | last post by:
Hi, Lets say I have a MIXED tag in my XML DTD with content that is going to be rendered as HMTL, as well as a <boldand <italicstag. What about whitespace? Specifically, does the whitespace in...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.