bhomass
asked on
preserve the head element attributes in w3c dom
I am using w3c dom to create html templates. I added some attribute to the <head> tag. after I apply transformer.transform(doms ource, streamresult), the transformer removes the attributes, and in fact completely took over the inner tags of <head> as well.
is that any way I can tightly control the <head> tag while generating html (xml) from the w3c dom?
is that any way I can tightly control the <head> tag while generating html (xml) from the w3c dom?
ASKER
I tested this over and over.
I can get a fragment out starting with <head>, then the head tag's attribute and inner tags are preserved.
but if I start with the <html> tag, then <head> gets the default output, discarding all the changes I made to it.
you can try this yourself.
>>That shouldn't happen. You need to copy what you need to retain
Not sure what your point is.
you think there is something I did wrong with the transformer? or the transformer is doing what it is supposed to be, and I need to manually modify the output?
I am not sure what you are saying exactly.
I can get a fragment out starting with <head>, then the head tag's attribute and inner tags are preserved.
but if I start with the <html> tag, then <head> gets the default output, discarding all the changes I made to it.
you can try this yourself.
>>That shouldn't happen. You need to copy what you need to retain
Not sure what your point is.
you think there is something I did wrong with the transformer? or the transformer is doing what it is supposed to be, and I need to manually modify the output?
I am not sure what you are saying exactly.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That shouldn't happen. You need to copy what you need to retain