Just trying to get my feet wet playing with epubs; trying to use XMLStarlet to update the metadata file inside an epub. Somehow, when I extract the metadata file to disk, then use that, it works. But if I extract to stdout and pipe to XMLStarlet, it doesn't. Clueless here …
- It's not a problem with the unzip output; if I replace the unzip command with 'cat content.opf' I get the same results.
- If I have only 1 namespace declaration, it does work.
- Changing the order of the namespace declarations doesn't affect the result.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can't reproduce your problem, can you post the ouput from -version and the exact command that fails. Does it work if you use "-" (indicating stdin) as the file name?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just trying to get my feet wet playing with epubs; trying to use XMLStarlet to update the metadata file inside an epub. Somehow, when I extract the metadata file to disk, then use that, it works. But if I extract to stdout and pipe to XMLStarlet, it doesn't. Clueless here …
works and returns
but
does not. Instead, I just get the usage text.
- It's not a problem with the unzip output; if I replace the unzip command with 'cat content.opf' I get the same results.
- If I have only 1 namespace declaration, it does work.
- Changing the order of the namespace declarations doesn't affect the result.
Correction: the second listing should read
to extract only the metadata file from the epub.
I can't reproduce your problem, can you post the ouput from -version and the exact command that fails. Does it work if you use "-" (indicating stdin) as the file name?
OK, I don't know where those semicolons crept in. The version is 1.0.1, as packaged for openSUSE 11.3.
The following command works:
But
does not. If I only define a single namespace, it works. But then I can't select individual elements within /package/metadata:
However, it turns out the multiple namespaces work when I explicitly set stdin as the file using "-" as suggested, thanks! My amateur skills showing …
Why does it keep putting those semicolons in there?
1.0.1 is pretty old, you might be hitting bug #1722425: many -N options on command line bug.
It seems like the forum adds semicolons every time it finds a url inside quotes, you can block it by putting the url inside a url bbcode tag.