I have to pass back information from a different source and can have a transformation in between, But depending on if the source document has the xml processing instruction, I have to pass it on and if it doesnt, I shouldnt pass it on.
Input
<?xml version="1.0" encoding="UTF-8"?>
<Source/>
Output
<?xml version="1.0" encoding="UTF-8"?>
<Source/>
If it doesnt have the processing instruction, I shouldnt include it in the output, mainly to support some other legacy programs which do not understand them (duh!)
I can dynamically switch stylesheets and use the omit-xml-declaration based on if the input had the instruction, but is there a way to do it in a single stylesheet?
EDIT: I cant remove the transformation that is present prior to returning the data.
EDIT: I just read that even though it looks like a processing instruction, the <?xml version.. ?>
, infact it is not, so not sure if it is possible to match on it, any suggestions?