What is the fastest possible xsl style sheet to add another <box> node under <boxes> ?

What is the fastest possible xsl style sheet to add another <box> node under 
<boxes> ?

<foo>
 <car></car>
 <boxes>
  <box id="234" />
  <box id="75" />
 </boxes>
</foo>

here is what i want it to look like after the xsl adds another box node:

<foo>
 <car></car>
 <boxes>
  <box id="89">
   <bar id="1" />
   <bar id="35" />
  </box>
  <box id="234" />
  <box id="75" />
 </boxes>
</foo>

notice that the node i want to insert under /foo/boxes is:

  <box id="89">
   <bar id="1" />
   <bar id="35" />
  </box>

and i want it to appear at the top of the list, befor the other two <box> 
nodes 


0
11/1/2007 2:42:47 AM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
801 Views

Similar Articles

[PageSpeed] 25

DR wrote:
> What is the fastest possible xsl style sheet to add another <box> node under 
> <boxes> ?
> 
> <foo>
>  <car></car>
>  <boxes>
>   <box id="234" />
>   <box id="75" />
>  </boxes>
> </foo>
> 
> here is what i want it to look like after the xsl adds another box node:
> 
> <foo>
>  <car></car>
>  <boxes>
>   <box id="89">
>    <bar id="1" />
>    <bar id="35" />
>   </box>
>   <box id="234" />
>   <box id="75" />
>  </boxes>
> </foo>
> 
> notice that the node i want to insert under /foo/boxes is:
> 
>   <box id="89">
>    <bar id="1" />
>    <bar id="35" />
>   </box>
> 
> and i want it to appear at the top of the list, befor the other two <box> 
> nodes 
> 
> 

<xsl:stylesheet ...>
   <!-- copy all as is -->
   <xsl:template match="@*|node()">
     <xsl:copy>
       <xsl:apply-templates select="@*|node()"/>
     </xsl:copy>
   </xsl:template>

   <!-- boxes element is special -->
   <xsl:template match="boxes">
     <!-- copy boxes element and its attributes -->
     <xsl:copy>
       <xsl:apply-templates select=@*/>
       <!-- append new content -->
       <box id="89">
         <bar id="1" />
         <bar id="35" />
       </box>
       <!-- process (copy actually) the rest children -->
       <xsl:apply-templates select="node()"/>
     </xsl:copy>
   </xsl:template>
</xsl:stylesheet>

-- 
Oleg Tkachenko [XML MVP, MCPD]
http://www.tkachenko.com/blog | http://www.XmlLab.Net
0
some2113 (163)
11/1/2007 9:01:28 AM
Reply:

Similar Artilces:

Why access add blank record in table
Greeting, I have a table without Primary key. When I want to add new records in this table, I open form to do that. The problem is when I decided to exit this form without adding new records; a blank record has been added to the table. Note: there is a macro in on load of the form event to reset the value of all textboxes and combos. Any help please Hi Jon, > I have a table without Primary key. That's your first mistake. Every table *should* have a primary key (or, as a minimum, a uniquely indexed field). > The problem is when I decided to exit this > form without addi...

Is it possible... #2
Is it possible to merge two excel files together if there is something that ties them together? I have two excel files that i need to merge together by "Location Name". Each file has different information for each location and I need to get them together into one file. Can HLookup or VLookup be used? I cannot copy/paste, not all of the Locations in one file are in the other and these files are too large for me to sift through manually. Any help would be greatly appreciated. Thank you! Hi yes this is possible. Probably VLOOKUP will work for you. If you could outline the layo...

list box error msg
is there any way i can change/modify the error message "the text you entered isn't an item in the list" since i enabled the property Limit to Yes? -- ai® Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200705/1 On Tue, 15 May 2007 03:49:10 GMT, ai_enjoi via AccessMonster.com wrote: > is there any way i can change/modify the error message "the text you entered > isn't an item in the list" since i enabled the property Limit to Yes? Just your own message? Code the Combo Box NotInList event: MsgBox "...

Fastest way to do this?
I have 10000 logins and their respective passwords. Logins are in col A and passwords are in B. Logins contain serial no. like LGN00001 to LGN10000 What I want is to have the first 200 logins/ pwds on the first page like 1 to 50 in col A,b then 51 to 100 in C,D then 101 to 150 in E,F and 151 to 200 on G and H, The same thing is repeated for the rest of logins. 201 to 250 on A,B etc. any cool macro would help. thx Here's a very straight-forward macro Sub ReFormat() Dim iSource As Long Dim iTarget As Long iSource = 1 iTarget = 1 Do Cells(iSource, "A")...

Reference Sheet name in a cell?
Hi, I have a cell (A1) that contains a formula which returns a sheet name depending on some other criteria. How do I reference that sheet name in a formula in another cell? eg: =Vlookup(b1,a1!$A:$M,2,false) Any help appreciated. thanks Nathan =VLOOKUP(B1,INDIRECT("'"&A1&"'!A:M"),2,FALSE) -- Regards, Peo Sjoblom "Nathan Sanders" <pas97ltd@xtra.co.nz> wrote in message news:8rbie.504$U4.78841@news.xtra.co.nz... > Hi, > > I have a cell (A1) that contains a formula which returns a sheet name > depending on some other...

Amort table
Hi all, I've been playing around what the amortization table template, and have notice a perculiar oddity, and wanted to know what you thought. I plunked into a couple extra columns on the right of the table and made a cumlitive pricipal entry. Simple enough. Wouldn't you think that when the loan is all paid off, the total amount of pricipal paid would be zero? I sure did! Nope, not the case according to Excel. It almost always several dollars off up or down. The first thing that came to mind was it was some kind of rounding error, so I put in a few rounding fuctions on th...

easy way to add all contacts from a DL out of Global address book to personal contact
hi, is there an easy way to add all contacts that are assigned to a distribution list within the global address book to my personal contacts? I could only add them contact per contact, but didn't find a way to e.g. add all 70 contacts from a DL automatically to my address book . any ideas? I don't want to add the DL, just the contacts of the DL.... thanks, stefan ...

Specify style and color of marker in chart
Hello -- User plans to plot no more than 8 data series, and Wants series marker to be a: - specified style("shape") (chosen from among 8 preferred shapes), and - solid color (chosen from among 8 preferred colors) Shape and color are arbitrarily assigned, depending on the sequence in which the series is plotted. Current code successfully plots the data, but does not assign marker style or color the way we want. Can someone tell me what is wrong with the following code? Function SeriesPlot( _ SeriesNum As Integer, _ SeriesName As String, _ RangeSeries As...

Add BCC to emails
Hi, I'm running Outlook 2002 SP3 and need to add the BCC option to my mails. I had assumed that this would have been done via the View option, but I can't find it - anyone any suggestions as to how I do it? It will need to be permanent i.e. the option to be able to send bcc to be on every email I write -- Cheers Peter (Reply to address is a spam trap - pse reply to the group) Does this help? How to reveal the Bcc box in Outlook http://support.microsoft.com/kb/299804 Petert wrote: > Hi, I'm running Outlook 2002 SP3 and need to add the BCC option to my &...

Add expiration date to work orders and quotes
Anyone know of a way to add the expiration date to work orders and quptes? Thanks, Nick Use the variable Transaction.OrderDueDate Here is an example: <IF> <CONDITION> (Transaction.Type = TransactionLayaway) </CONDITION> <THEN> <ROW> "Expires: " Transaction.OrderDueDate "|" </ROW> </THEN> </IF> <IF> <CONDITION> (Transaction.Type = TransactionBackorder) </CONDITION> <THEN> ...

VbScript to change Access Trust Center to add a Folder.
Running Access 2007 using the old .mdb from Access 2003 my back end is SQL Server 2008. I will be installing Access 2007 onto my users PC. What I need is a script, preferable VBScript, to run, that will add a folder to the trusted location, this folder contains all my databases from Access 2003 and other files. Anyone have a script like that already running? I am sure it wouldn't be too hard, but I am still learning Access 2007. Thanks -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-conversion/200906/1 You can just set it in the Registr...

Not sure if this is possible
I am in charge of Payroll in my company, and at the end of the year have to compile a very large excel sheet showing what each employe made, for tax purposes. I have a digital copy of all the payroll o the computer, which is also excel sheets. My question is this: Is it possible to make a formula that will take the money that the made from the one document onto this new one? If so, how -- C_Purbaug ----------------------------------------------------------------------- C_Purbaugh's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3519 View this thread: http://...

Fastest method
Hi, What is the fastest .NET method of opening an XML file (no schema validation) and doing basic XPath Queries? Thanks Richard. "Richard Bower" <richardbower@hotmail.com> wrote in message news:u2inuBY$DHA.2516@TK2MSFTNGP11.phx.gbl... > What is the fastest .NET method of opening an XML file (no schema > validation) and doing basic XPath Queries? The XPathNavigator class in the System.Xml.XPath namespace is most highly optimized for performing queries. If by queries, you mean those that node-sets, then you'd use: - - - CreateXPathNav.cs (excerpt) using System....

Having a cell control an autofilter on another sheet
Hello: I have a spreadsheet with a large data field that is sorted b autofilter. I want to have cells on another sheet that will contro the autofilter. Here is my data source: A B C Year Name Time 2000 Ed 2 2001 Steve 4 2000 Mike 3 So, I want to be able on another sheet, enter "2000" in a cell (o select in a drop down box) and it to autofilter the above data for al entries with 2000 in the year column. Thanks for the help!!! Phi -- philw1 -------------------------------------------------------------------...

Problem with hiding ALL sheets?
Does Excel have a problem if I want to set ALL of sheets' visible property to "xlSheetVeryHidden"??? My code crashes if I try to hide my my last sheet. I'm wondering if my code is flawed, or maybe Excel just doesnt accept making everything "very hidden"?? thank you Gotta have, at least, one. -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "Robert Crandal" <nobody@gmail.com> wrote in message news:7cb%m.393$V_3.105@newsfe09.iad... > Does Excel have a problem if I want to set ALL of > sheets...

Possible Bug: Outlook Connector keeps creating new TCP Connections!
I run outlook 2007 with Outlook connector to sync my hotmail on Win7 RTM. I notice constant network access. Win7 Resource monitor shows that Outlook has several TCP connections to Hotmail server. What is odd, it creates several new TCP connections every second! Any insight? ...

Buttons with XP Style
Hello World! I have a very unuseful question, but as we use to say "programming is an art", so let's do it with style! How can I set up buttons so they can appear with Windows XP style? In .NET I set to "System" the FlatStyle property, but in MFC applications this property is absent! Thanks in advance for your help! Greetings from Italy! Ok! Sorry... I've found the answer by myself! Take a look here! http://www.codeguru.com/Cpp/controls/buttonctrl/windowsxp/article.php/c5193/ "Paolo Niccol�" <axettone@xiengeen.com> ha scritto nel messaggio n...

cancel another user's appointments : is it possible?
Let's say a secretary has rights to her boss's calendar in her Outlook (2000). Is there a way she can cancel appointments that were created by him? Right now she can only cancel the ones she created. Thanks in advance. What permissions does she have? I've never tried this, so I can't say for sure that it will send out the 'cancel' notifications for meetings he's set up himself even if she has sufficient privileges in his calendar....but it's where I'd check first. johndoe wrote: > Let's say a secretary has rights to her boss's calendar in h...

Tax box on POS
My Store OP POS seems to have a new problem with retail taxes. Every item has been assigned as tax item. Also, to make sure all sales taxes are calculated, I assigned customer taxes as well. A few items from the database still came up untaxed at the point of sale even though all have been checked and assigned as tax items. Z report also has been made. We have to remind the cashiers to double check the text box for every item at the point of sale. Did anyone have this problem? I think I am finding many problems posters here don't identify with because few are running apparel st...

Is this possible? #5
sorry but only used the fairly common features of Excel & not sure if this is possible? I have a spreadsheet (currently in Excel 97 format) with 8 worksheets on, there is some information I need visible on every worksheet - do I have to copy & paste it to all 8 worksheets or is there a way of entering it only once but still being visible globally? hope I've made sense? harry harry, one way would be to put a formula in the sheets to ref. the cell where you enter data, like this =Sheet1!A1 -- Paul B Always backup your data before trying something new Please post any response...

Linking a one Presentation to Another Presentation
I have several presentations that are linked to my main presentation so when you click a link the secondary presentation opens up. My problem is that everytime I click a link that new presentation opens, which is good, but it doesn't close when I link back to the "home page". Is it possible to have a presentation close when you click the link back to the home page? This sounds like a PowerPoint question? On Mar 17, 8:49=A0am, ElizabethS <Elizabe...@discussions.microsoft.com> wrote: > I have several presentations that are linked to my main presentation so...

hide columns on a protected sheet
When using MS Excel 2003: I have turned on "Protect Sheet" to protect some formulas/Cells from being deleted/changed. Prior to turning on protection I unlocked the cells that I wanted users to be able to edit. What I don't see on the "Protect Sheet" menu is an option to "Hide Columns" Do you know of any way that I can allow users to do this, without turning off the protection in MS Excel 2003? aww i figured it out.... "Rose" wrote: > When using MS Excel 2003: I have turned on "Protect Sheet" to protect some &...

DBTYP.NET Studio 2010
This is a multi-part message in MIME format. ------=_NextPart_000_006D_01CACB93.4CB100E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable DBTYP.NET Studio 2010 - Database Comparison Suite Released Vienna, Austria - March 8, 2010 Today, BYPsoft announced the availability of DBTYP.NET Studio 2010, the = newest version of the cross-database comparison tool that compares SQL = Server, MySQL and Oracle databases (schema and data). DBTYP.NET Studio = 2010 is available for download from http://www.bypsoft.com. With its rich sup...

Import from another spreadsheet
I am trying to update a very large spreadsheet (100k + records) with a updated spreadsheet. The original spreadsheet is the property record for the county that I live in. The new sheet is an update of propertie sold. Each sheet uses a unique "PIN" (Property Indentity Number) fo every property record in the county. How do I match the "PIN's" from the new sheet to the old sheet. I woul only want to import and update three filelds ("Sale Year", "Sale Month" and "Sale Price") from the new sheet to the old sheet. Thanks, Rob Caldwel -- home...

is it possible to have kalender open together with the innboks
I want the calender open at right when i work inn the innbox. Uotlook 03 only if you open two windows side by side. outlook 2007.2010 use the to-do bar which shows you upcoming appts in all mail folders. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchange: mailto:EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM Poll: What version of Outlook do yo...