xmlstarlet
This commit is contained in:
parent
c7c9b9f9ec
commit
7a1219c05e
|
@ -0,0 +1 @@
|
|||
g++ xmlattrsort.cpp -o xmlattrsort && cat klimov6.xml | iconv -f cp1251 -t utf-8 | ./xmlattrsort
|
Binary file not shown.
|
@ -0,0 +1,30 @@
|
|||
#include <cstdlib>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
/*
|
||||
* Читаем xml файл в переменную xml
|
||||
*/
|
||||
|
||||
string xml;
|
||||
char c;
|
||||
|
||||
while ((c = getc(stdin)) != EOF)
|
||||
xml += c;
|
||||
|
||||
|
||||
/*
|
||||
* В цикле просматриваем всю xml
|
||||
*/
|
||||
|
||||
for (size_t i = 0, max_i = xml.length(); i < max_i; i++) {
|
||||
cout << xml[i];
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
SRC=$1
|
||||
|
||||
str=str
|
||||
while [[ "$str" != "" ]]; do
|
||||
read str
|
||||
tag_name=`sed "s~^[\t,\ ]*\(<[^\t,^\ ]*\)\(.*\)~\1~g"`
|
||||
|
||||
#~ echo $str
|
||||
done
|
||||
|
||||
#~ cat $1 | iconv -f cp1251 -t utf-8 | grep -v '<Ch '
|
Loading…
Reference in New Issue