473,657 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading output xml in the same XSLT, which perform the transformation

I am having a XSLT which transforms an input XML to transformed XML.
I want to get the count of some nodes in the transformed XML, in the
same XSLT.
Is it do able?. Is it possible to read Output XML, in the same XSLT
which perform the transformation.

Jul 20 '05 #1
2 1251


ti*******@yahoo .com wrote:
I am having a XSLT which transforms an input XML to transformed XML.
I want to get the count of some nodes in the transformed XML, in the
same XSLT.
Is it do able?. Is it possible to read Output XML, in the same XSLT
which perform the transformation.


Only with an extension function which converts a result tree fragment to
a nodeset. You would store the result tree fragment in a variable and
then use
count(exsl:node-set($variable))
see
<http://www.exslt.org/exsl/functions/node-set/index.html>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
No xxx:node-set() extension function is necessary in XSLT 2.0 as there's no
RTF type there.

Cheers,
Dimitre Novatchev

"Martin Honnen" <ma*******@yaho o.de> wrote in message
news:42******** *************** @newsread2.arco r-online.net...


ti*******@yahoo .com wrote:
I am having a XSLT which transforms an input XML to transformed XML.
I want to get the count of some nodes in the transformed XML, in the
same XSLT.
Is it do able?. Is it possible to read Output XML, in the same XSLT
which perform the transformation.


Only with an extension function which converts a result tree fragment to a
nodeset. You would store the result tree fragment in a variable and then
use
count(exsl:node-set($variable))
see
<http://www.exslt.org/exsl/functions/node-set/index.html>

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3

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

Similar topics

0
2083
by: Dimitre Novatchev | last post by:
You seem to be unaware of the xslt processing which uses the built-in rules in the absence of templates that match some selected node. http://www.w3.org/TR/xslt#built-in-rule According to the XSLT processing model: http://www.w3.org/TR/xslt#section-Processing-Model the root node will be processed by a built-in rule, because you do not
5
3551
by: Marcel Akkerman | last post by:
Hi, Does anyone have a clue how to reduce the number of nodes using XSLT? When outputing all nodes in order I could just use <xsl:for-each select="name"> But what if I, besides sorting and grouping, I also output conditionally? <xsl:for-each
4
4725
by: Mike Conmackie | last post by:
Hi Folks, I've probably omitted something very basic but I have no idea what it might be. The results of my transformation _should_ be an xml file but all I get is the xml declaration immediately followed by the input node text values in one long string -- no xml tags (barring the xml declaration, of course) appear in the output file. Anyone who wants to see either the input xml file or the xsl file, please let me know and I will...
5
7382
by: Mike Judkins | last post by:
I'm looking for examples of websites (preferably large and well known companies, not personal sites or developer-to-developer sites) that use XML and XSLT as a technology platform from which to store and render web content. Reason being that we are considering migrating our website content to XML and using XSLT to transform the content into html. Currently lack of browser support for XSLT has held us back. For example a significant...
2
1219
by: Zhou Lei | last post by:
Hello I have transformed the XML to XHTML document and would like to validate the output, how can I save the XML output result (XHTML)? I transform it on client side. And the server-side transformation always eliminate a slash, for example if I want the result be <img src="a.gif" />, the result will always be <img src="a.gif"> without the slash. The server is running Apache with cocoon. Anyone could help on that, thank you.
1
1504
by: KwiKiwi | last post by:
Hey, I'm doing a series of XSL Transformations from a C#.NET Console app. I've designed a .xsl file (to output to "text" not "xml") to generate a text file with entries that look like: "<OD:FO:"yes.gif",Picture,"C:\images\yes.gif">" I designed the .xsl file in Marrowsofts Xselerator application and when I
6
3233
by: Christopher | last post by:
I am currently in the process of evaluating the performance hits of moving to the .NET platform for our application. I created a sample project that loads the transforms the same XML and XSLT in COM, COM using interop and in C# and then transforms it to HTML. I also tried concatenating the XML and XSL as a string and then loading it to the DOM once as opposed to loading the DOM with the appendChild() method. I see that the C# version is...
1
2083
by: SteveB | last post by:
I'm porting an application from Apache Xerces to .Net and am having a couple of small problems with deserialization. The XML that I'm reading comes from a variety of sources, and there are two inconsistencies that Xerces is able to handle that XmlSerializer seems not to be able to deal with. 1) Some of the boolean values that I'm dealing with are "True" and "False" rather than "true" and "false". I'm not quite sure whether "True" and...
3
9584
by: super.raddish | last post by:
Greetings, I am relatively new to, what I would call, advanced XSLT/XPath and I am after some advice from those in the know. I am attempting to figure out a mechanism within XSLT to compare the difference between two source documents and output node-sets which are "different" (changed or new) to new XML files using xsl:result-document To describe the problem I have provided some example data below along with my a portion of my current...
0
8421
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
8325
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
8844
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...
1
8518
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
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...
1
6177
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5643
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
4173
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
4330
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.