Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to store each node or attribute in XSLT?

Posted on 2011-02-28
3
Medium Priority
?
330 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

886 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