473,799 Members | 3,077 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1285


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">Emp ire Burlesque</title>
<artist>Bob Dylan</artist>
<price>10.90</price>
</cd>
<cd>
<title year="1995">Hid e your heart</title>
<artist>Bonni e Tyler</artist>
<price>9.90</price>
</cd>
<cd>
<title year="1995">Gre atest Hits</title>
<artist>Dolly Parton</artist>
<price>9.90</price>
</cd>
<cd>
<title year="1995">Sti ll got the blues</title>
<artist>Gary Moore</artist>
<price>10.20</price>
</cd>
<cd>
<title year="1998">Ero s</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">Emp ire Burlesque</title>
<artist>Bob Dylan</artist>
<price>10.90</price>
</cd>
the xsl used
<?xml version="1.0"?>
<xsl:styleshe et 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">Emp ire Burlesque</title>
<artist>Bob Dylan</artist>
<price>10.90</price>
</cd>
<cd>
<title year="1995">Hid e your heart</title>
<artist>Bonni e Tyler</artist>
<price>9.90</price>
</cd>
<cd>
<title year="1995">Gre atest Hits</title>
<artist>Dolly Parton</artist>
<price>9.90</price>
</cd>
<cd>
<title year="1995">Sti ll got the blues</title>
<artist>Gary Moore</artist>
<price>10.20</price>
</cd>
<cd>
<title year="1998">Ero s</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">Emp ire Burlesque</title>
<artist>Bob Dylan</artist>
<price>10.90</price>
</cd>
the xsl used
<?xml version="1.0"?>
<xsl:styleshe et 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
2338
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 the info back to the Object, wich show the stuff.. AddBlock( $type ) - Creates an empty blok - wich is addet to a blocks area object...( Or somethin like it ) Store() - safes the info into a file, and updates mySQL... I have figured out most...
3
3331
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 page stating that some fields have not been filled out. I don't want a pop-up, I just want to send them back. I had seen something that did this using <div /> tags but cant seem to find one I can modify to work for this application. I was...
5
2163
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 intellisense when I specify the name space. But leaving hte namespace in messes up my transforms. Is there any way to get this intellisense functionality without adding the namespace all the time? Thanks,
2
1219
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 I set the SelectedValue for the second list, the first list's SelectedValue becomes set to the SelectedValue of the second list. I'm also getting this exception during the render process: "A DropDownList cannot have multiple items selected."...
10
1945
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"> <input type="hidden" name="thisPage" value="pispCheckDomain"> <input type="hidden" name="username" value="test"> <input type="hidden" name="password" value="test"> domain_name: <input type="text" name="domain_name"><br>
22
2850
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 int. I would like to know how could this is done? I can see only one way currently and I know that there must be a better method. Right now I would be tempted to pipe the output of the command to a temp file and then get the data from the file....
1
9485
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:- onclick="retrieveURL('/application/home_page.do?processAction=ItinerarySearch','AfoHomeForm')" after clicking on button i am getting following error:- object does not support this property or method at statement (Which i have made it bold in js file)
11
2609
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 library as I thought this would be a good start!!!) but nothing happens :- Imports System.Timers
2
2434
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 column 'EmployeeID', table 'Accomplishments.dbo.Accomplishment'; column does not allow nulls. INSERT fails. The statement has been terminated. and my code is this using System; using System.Collections;
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9538
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10473
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10249
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10025
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6804
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5461
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5584
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.