Solved

How to store each node or attribute in XSLT?

Posted on 2011-02-28
3
320 Views
Last Modified: 2012-05-11
Hi,
I have to write an XSLT which has to read almost all nodes and attribute. more than one time.
and has to write is there any concept of stack or storage that stores the nodes or attributes to write them after words?

0
Comment
Question by:SANbuddies
  • 2
3 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 50 total points
ID: 34998469
Nope, there is not (unless you would do multiple passes)
Variables don't vary in XSLT,
but that usually is not a problem,
since you can process the source tree as many times as you need to and you always have full XPath access to the full tree

Instead of creating a stack with information, just write some XPath that process the tree to give you exact info when you need it
0
 

Author Comment

by:SANbuddies
ID: 34998490
yes but processing is simple but writing is difficult if you are not copying the tree.
Traversing twice same tree will consume more resources.
and XPATH is only good when you know the XML but if its varying then you need to have a foreach loop.
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 34998553
Well, it all depends,
- instead of for-each use apply-templates, you will find that it works a lot more flexible (so writing becomes Not difficult),
 and the major memory consumption usually is in creating the tree, after that most sensible operations are fairly cheap
- you don't need to know the XML for XPath, there are patterns and wild cards (so I don't agree with your clsoing sentence)

Anyway, you asked a very general question which I answered as much as possible given the question detail

If you need more detail, I think you need to be more precise
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
.net c# 8 50
How to convertan Excel file into XML 16 27
Parsing the XML data to SQL Server 4 51
XML & .net 5 20
The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now