Automating line numbering
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 1
- Joined: Mon Oct 25, 2010 7:33 pm
Automating line numbering
Hello!
I have a large XML document in TEI that contains several thousand <l n="x"> entries, as well as <lb n="x"/"> entries as well. Is there any way to automate the entry of actual numbers in sequence, since doing them all by hand would be quite tedious?
Essentially I'm looking for a way to generate
l n=1
l n=2
l n=3
etc... automatically.
I have a large XML document in TEI that contains several thousand <l n="x"> entries, as well as <lb n="x"/"> entries as well. Is there any way to automate the entry of actual numbers in sequence, since doing them all by hand would be quite tedious?
Essentially I'm looking for a way to generate
l n=1
l n=2
l n=3
etc... automatically.
-
- Posts: 1
- Joined: Wed Nov 10, 2010 5:50 am
Re: Automating line numbering
you just try,
XPathDocument doc = new XPathDocument("..\\..\\dataset1.xsd"); XPathNavigator nav = doc.CreateNavigator();
XPathNodeIterator iter = nav.Select("*");
if (iter.MoveNext()){
XPathNavigator root = iter.Current;
IXmlLineInfo info = root as IXmlLineInfo;
Console.WriteLine(info.LineNumber +"," + info.LinePosition);
}
XPathDocument doc = new XPathDocument("..\\..\\dataset1.xsd"); XPathNavigator nav = doc.CreateNavigator();
XPathNodeIterator iter = nav.Select("*");
if (iter.MoveNext()){
XPathNavigator root = iter.Current;
IXmlLineInfo info = root as IXmlLineInfo;
Console.WriteLine(info.LineNumber +"," + info.LinePosition);
}
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service