Download presentation
Presentation is loading. Please wait.
Published byMilo Reginald Welch Modified over 6 years ago
1
An XML Toolkit for Lightweight XML Stream Processing
DW Lab. 김연정
2
Contents XML toolkit commands details Xcat Xrun Xsort xgrep Xnest
xpair Xflatten createSIX
3
Xcat(1) Concatenates the give XML files
xcat [-r <root>] [-i <indentation>] (<xml file>)+ Example Xcat –r item sample1.xml sample2.xml sample2.xml sample1.xml
4
Xcat(2) Result
5
Xrun(1) Sub-part of input xml that satisfies the given Xpath expression Xrun <xpath expression> <xmlfile> Examples xrun “/” sample2.xml xrun “/books/book/title” sample2.xml
6
Xrun(2) result Result1.xml Result2.xml
7
Xsort(1) Sorts target elements under a given context
Xsort [-m <mem size>] [-i <indentation size>] c <context> [-e <element to include> [-k “<key comparison>”]]+[<input file>] Example Xsort –c “root/bib” –e “*” –k “year” sample.xml
8
Xsort(2) Result Result.xml sample.xml
9
Xgrep(1) Copies to the output everything that is not under a context. For a context, it only copies the items that match an element expression and that satisfy the key comparison. Xgrep –c context [-e <element to include> -k ”<key comparison>”]]+[<input>] Example xgrep –c root/bib –e paper –k “year/text() > 1999” sample.xml
10
Xgrep(2) Result result.xml sample.xml
11
Xnest(1) Groups adjacent elements that have the same key under a common group tag Xnest [-gt <group-tag-name>] [-kt <key-tag-name>] –e <element to include> (-k <key> | -n number) [<input file>] Example xnest –gt books –e /root/bib/book sample3.xml
12
Xnest(2) Result Result.xml sample3.xml
13
Xpair(1) Pairs elements up with a context element under a pair tag
xpair [–p <pair tag>] –e <element to duplicate> g <element to pair up> [<input file>] Example xpair –p desc –e /root/bib/*/author –g /root/bib/*/title sample.xml
14
Xpair(2) Result Result.xml sample.xml
15
Xflatten(1) Removes the top-most element that matches the given XPath expression. (only removes element tags, not content) Xflatten [-r recursive remove] –e <element to remove> [input file] Example xflatten –e papers/paper/year sample1.xml
16
Xflatten(2) Result sample1.xml result.xml
17
createSIX Creates a streaming index(SIX) for the input xml file.
createSIX [-t <threshold>] <input file> Example createSIX sample.xml Result
18
Example Complex data operations
Xcat –r item sample1.xml sample2.xml | xsort –c “item/books” –e “book” –k “title” Result
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.