问题
I have an XML file and I need to start reading from a specific line number. As if the previous lines don't exist.
For example, if I need to count number of nodes starting from line # 23. This is to be done using VBScript in UFT (QTP).
回答1:
You can skip lines in text (line orientated) files by using the SkipLine method.
But XML documents are trees of nodes/elements. Whitespace out of elements has no meaning. So it may make sense to ask for the number of child nodes of a specific node (whether it starts on line #23 or not).
So
- describe your real world problem in a way that explains why you assume lines are relevant
- publish (a small but illustrative part of) your input xml
- state the expected output
- show the code your are experimenting with
来源:https://stackoverflow.com/questions/31680506/how-to-start-reading-from-a-specifc-line-in-an-xml-file