473,385 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Copying the first few xml elements

2
I have an xml file with the overall structure:

<a>
<b>
<c1>
</c1>
<c2>
</c2>
<c3>
</c3>
..
..
..
</b>
</a>

The xml file has hundreds of c elements and my goal is to write a xslt file that only copies the first 200 c elements in this file, ie up to and including the <c200> element, and delete the rest of the c elements. Does anyone know how?
Thanks in advance!
Dec 2 '09 #1
2 1502
gracec
2
When i say elements above I mean nodes. So what I mean is how to write a xslt file that only copies the first 200 c nodes in a xml file and deletes the rest. Help please.
Dec 2 '09 #2
Dormilich
8,658 Expert Mod 8TB
I could imagine that you can make a string comparison of the element name whether it contains a number <= 200. are you sure you mean nodes and not elements (attributes and text also counts as node)?

if you know the name of the 201st element you can make a for-each loop and use the position as test.

using DOM and a programming language would be easier though …
Dec 2 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bob Halley | last post by:
In dnspython I have a set class, SimpleSet. (I don't use Python 2.3's sets.Set class so I can keep supporting Python 2.2, and because the objects in my sets are mutable). The SimpleSet class has...
21
by: Matteo Settenvini | last post by:
Ok, I'm quite a newbie, so this question may appear silly. I'm using g++ 3.3.x. I had been taught that an array isn't a lot different from a pointer (in fact you can use the pointer arithmetics to...
5
by: Roy Hills | last post by:
When I'm reading from or writing to a network socket, I want to use a struct to represent the structured data, but must use an unsigned char buffer for the call to sendto() or recvfrom(). I have...
10
by: Xavier Noria | last post by:
Given two structures of the same size but different type, does C99 guarantee that pointers to them can be casted one to each other, and that the order of the elements will be kind of respected? ...
0
by: ryanr | last post by:
I've run into a problem with a recursive algorithm. Basically, it grabs a tree, and creates premutations based off it. For example: Suppose you have you sell shoes in two colors (Black,...
9
by: Jess | last post by:
Hello, I tried to clear a vector "v" using "v.clear()". If "v" contains those objects that are non-built-in (e.g. string), then "clear()" can indeed remove all contents. However, if "v"...
9
by: Mr John FO Evans | last post by:
Am looking at adding structures to an embedded C emulator but am wondering what the standard is for copying structures(ie structa=structb) which contain pointers to memory and which are therefore...
2
by: DaTurk | last post by:
This is probably a very silly, and simple question. If I'm coding in CLI, and I want to copy an array to an array, not a deep copy, just something of the nature arr1 = arr2, what is going on? I...
6
by: arnuld | last post by:
On Mon, 15 Sep 2008 13:15:23 +0100, Ben Bacarisse wrote: okay, you mean pointers are passed by copying. I have cooked a little program to understand it: #include <stdio.h>
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...

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.