[xml] creating new doc with root element (namespace)



Hi,

I\'m using PHP for running dom functions but
i think my problem is libxml specyfic.

The behavior of libxml changed lately so all
my scripts went crazy. The problem is that
I have some strings of data, which are text + 
embedded xml nodes here and there, example:

-- begin --
this is some text <bold>some other</bold>
some text here, some there<picture id=\"1\" />
-- end --

I have to assign this string as an xml data
(so that those \"floating\" tags are not changed to
\"less than\" and \"greater than\" representations)
to be then parsed by xslt processor.

Earlier I was doing a trick to create a new
xml document with this string being a part of it
and the root tags was <Somenamespace:Text>.
That was ok, but now the behavior is that 
<Somenamespace:Text> becomes <Text> when outputting
the final xml document. I see that this is probably
proper behavior because there is no namespace 
declaration in the newly created xml doc (the one 
created for the purpose of this string with \"floating\" 
tags).

The problem is that I have declared this namespace
in the xml doc that i\'m appending that other newly
created xml doc. So that there are two declarations
that are the same.

What i need is to somehow parse a string 
that contains those \"floating\" tags so 
that i can pass it to newchild.

Is this possible?













[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]