Confine pretty-printing to teiHeader
Posted: Wed Apr 24, 2019 1:53 am
Hi
I wrote an XSLT to edit a folder of 400+ XML documents. It was meant to adjust many elements inside teiHeader/fileDesc without changing anything substantive in the rest of the teiHeader or in the text portion. When I added indent="yes" to the XSLT, it pretty-printed the whole header of the XMLs, which was fine, but also reformatted the text portion, which was a disaster. Not only was the text now very hard to read and work with, but I discovered much too late -- after a lot of further work -- that addition or removal of spaces between tags meant that the resulting processed text had occasional missing interword spaces and conversely, unwanted intraword spaces. I assume I'll have to revert and start again. If so, I need to be sure of not corrupting my texts.
Is it possible to use indent="yes" in an XSLT file but confine its operation to the teiHeader only, or even to just those parts of the file affected by specific templates? Alternatively, to first prettify a folder of files with Format and Indent, but again ONLY formatting their teiHeaders, and then to use an XSLT with indent="no" which completely faithfully copies unchanged elements -- in this case, much of the header and the whole text portion? Thanks for any pointers.
D
I wrote an XSLT to edit a folder of 400+ XML documents. It was meant to adjust many elements inside teiHeader/fileDesc without changing anything substantive in the rest of the teiHeader or in the text portion. When I added indent="yes" to the XSLT, it pretty-printed the whole header of the XMLs, which was fine, but also reformatted the text portion, which was a disaster. Not only was the text now very hard to read and work with, but I discovered much too late -- after a lot of further work -- that addition or removal of spaces between tags meant that the resulting processed text had occasional missing interword spaces and conversely, unwanted intraword spaces. I assume I'll have to revert and start again. If so, I need to be sure of not corrupting my texts.
Is it possible to use indent="yes" in an XSLT file but confine its operation to the teiHeader only, or even to just those parts of the file affected by specific templates? Alternatively, to first prettify a folder of files with Format and Indent, but again ONLY formatting their teiHeaders, and then to use an XSLT with indent="no" which completely faithfully copies unchanged elements -- in this case, much of the header and the whole text portion? Thanks for any pointers.
D