Skip to content

gerard10/XSLT_Dump_estructure_nodes

Repository files navigation

XSLT_Dump_estructure_nodes

XSLT files to dump all nodes of XML file using XSLT processor
Similar what you get with xmlstarlet with thix commnad
xmlstarlet.exe el -v your_xml_file.xml

but using a xslt
like this:
$ xsltproc.exe dump_xml_structure_path.xslt book_catalog_02.xml |head
/catalog
/catalog/cd[@id=1]
/catalog/cd/title
/catalog/cd/artist
/catalog/cd/country
/catalog/cd/company
/catalog/cd/price
/catalog/cd/year
/catalog/cd[@id=2]
/catalog/cd/title
...

From a xml file like this:

<title>Empire Burlesque</title> Bob Dylan USA Columbia 10.90 1985 <title>Hide your heart</title> Bonnie Tyler UK CBS Records 9.90 1988 <title>Greatest Hits</title> Dolly Parton USA RCA 9.90 1982

You get this:
/catalog
/catalog/cd[@id=1]
/catalog/cd/title
/catalog/cd/artist
/catalog/cd/country
/catalog/cd/company
/catalog/cd/price
/catalog/cd/year
/catalog/cd[@id=2]
/catalog/cd/title
...

/catalog/cd/year

I make 4 xslt files. dump_xml_structure_path.xslt -- dump node like aboce
dump_xml_structure_path_html.xslt -- dumo like above into HTML
dump_xml_structure_path_pipe_text.xslt -- dump like above and add a pipe and the value of the node at end of line
dump_xml_structure_path_pipe_text_html.xslt -- dump like above and add a pipe and the value of the node at end of line into HTML version

About

XSLT files to dump all nodes of XML file using XSLT processor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages