473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

getting the output in the form of xml

sp
hai

i have got
1. an xml file
2. an xsl file

and my xsl file filters the xml based on attribute value

and the output i receive is in the ordinary format

could any help in getting the output in the form of xml

i tried

<xsl:output method="xml" />

this is not working

i worked on VC++ to know the output string but i am receiving only the
tag values as output i need the entire xml matching the filter
condition.

plz help me to get the output in the correct format

thanks
praveen

Jan 24 '06 #1
3 1273


sp wrote:

i have got
1. an xml file
2. an xsl file

and my xsl file filters the xml based on attribute value

and the output i receive is in the ordinary format
What exactly is "the ordinary format", plain text, or HTML, or what else?

could any help in getting the output in the form of xml

i tried

<xsl:output method="xml" />

this is not working


Well what exactly does your stylesheet look like, how does your input
XML look?
Make sure that your XSLT stylesheet creates result elements with e.g.
<xsl:copy>
or with
<xsl:element>
or with literal result elements, it does not suffic to use e.g.
<xsl:value-of select="." />
to create elements.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jan 24 '06 #2
sp
the xml file i used
<catalog>
<cd>
<title year="1990">Empire Burlesque</title>
<artist>Bob Dylan</artist>
<price>10.90</price>
</cd>
<cd>
<title year="1995">Hide your heart</title>
<artist>Bonnie Tyler</artist>
<price>9.90</price>
</cd>
<cd>
<title year="1995">Greatest Hits</title>
<artist>Dolly Parton</artist>
<price>9.90</price>
</cd>
<cd>
<title year="1995">Still got the blues</title>
<artist>Gary Moore</artist>
<price>10.20</price>
</cd>
<cd>
<title year="1998">Eros</title>
<artist>Eros Ramazzotti</artist>
<price>9.90</price>
</cd>
<cd>
<title year="1998">One night only</title>
<artist>Bee Gees</artist>
<price>10.90</price>
</cd>
</catalog>
the output expected
<cd>
<title year="1990">Empire Burlesque</title>
<artist>Bob Dylan</artist>
<price>10.90</price>
</cd>
the xsl used
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" />
<xsl:template match="/">
<xsl:for-each select="/catalog/cd[title[@year='1990']]">
<xsl:value-of select="." />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

my output is

Empire Burlesque Bob Dylan 10.90
is there anything i have to change in the xsl to get the output in the
xml format

Jan 25 '06 #3
sp
the xml file i used
<catalog>
<cd>
<title year="1990">Empire Burlesque</title>
<artist>Bob Dylan</artist>
<price>10.90</price>
</cd>
<cd>
<title year="1995">Hide your heart</title>
<artist>Bonnie Tyler</artist>
<price>9.90</price>
</cd>
<cd>
<title year="1995">Greatest Hits</title>
<artist>Dolly Parton</artist>
<price>9.90</price>
</cd>
<cd>
<title year="1995">Still got the blues</title>
<artist>Gary Moore</artist>
<price>10.20</price>
</cd>
<cd>
<title year="1998">Eros</title>
<artist>Eros Ramazzotti</artist>
<price>9.90</price>
</cd>
<cd>
<title year="1998">One night only</title>
<artist>Bee Gees</artist>
<price>10.90</price>
</cd>
</catalog>
the output expected
<cd>
<title year="1990">Empire Burlesque</title>
<artist>Bob Dylan</artist>
<price>10.90</price>
</cd>
the xsl used
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" />
<xsl:template match="/">
<xsl:for-each select="/catalog/cd[title[@year='1990']]">
<xsl:value-of select="." />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

my output is

Empire Burlesque Bob Dylan 10.90
is there anything i have to change in the xsl to get the output in the
xml format

Jan 25 '06 #4

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

Similar topics

2
by: Timo J | last post by:
Hi - Im sitting and trying to understand this OOP - and need to create a class wich can do the following.. ShowBlocks() - Displays the data wich is inside it - If empty creates a form wich sends...
3
by: Matt Herson | last post by:
I am looking for a validation script that will only look at the fields in the cgi form, determine if the fields are filled out, then if one or more are blank will write a message at the top of the...
5
by: Don | last post by:
Hi: I have created an xsd from my xml document. I pop this xsd in the following directory: C:\program files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml. That give me...
2
by: Jay | last post by:
I'm having a weird problem in ASP.NET 1.1. I have two DropDownLists in a form. Both lists are build identically but separately. Somehow the DropDownLists are getting crossed in memory, because when...
10
by: Peter Afonin | last post by:
Hello, I have a simple client-side form that is checking the domain availability on the domain registrar's server: <FORM action="https://www.webnames.ru/scripts/RegTimeSRS.pl" method="post">...
22
by: SF | last post by:
Hello All, In a windows C learning project I am wokring on I use the system function to run a command, I want to suck the results into a vairable. The system function seems to only return an...
1
by: kamleshsharmadts | last post by:
I am using Ajax with struts in web application. from jsp i am calling a function of ajax.js onclick of a button. code of that call function which calling from jsp given as below:- ...
11
by: Hotrod2000 | last post by:
I'm quite new to programming but I'm having problems getting a timer to work in visual studio.net I've created a timer on a form, enabled it and then typed the following code (from the mdsn...
2
by: preeti13 | last post by:
Hi guys i am here with my another probelm please help me.trying insert the value into the data base but getting the null value error .I am getting thsi error Cannot insert the value NULL into...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.