Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading XML string vs. file

Status
Not open for further replies.

Muddmuse

Programmer
Jul 31, 2001
85
US
I have an XML file that when loaded into the DOM and transformed with XSL produces the desired results. When the same XML is loaded into the DOM as a string I get a &quot;Element <CCC> not allowed in this context&quot; error. Why?

Here is something similar to the XML I'm using:

<AAA>
<BBB>Here is some text</BBB>
<BBB>and more <CCC seq=&quot;1&quot;/> text</BBB>
</AAA>
 
>> When the same XML is loaded into the DOM

What DOM? How are you loading it? In a program? What sort of program? What language? [bugeyed]

-pete
 
MSXML4 using ASP. Sorry for the vague description.

The app I'm working on sends an XML string returned from a COM component with a datatype attribute set to string (dt:dt=&quot;string&quot;) on each node, which I did not indicate in my example. When that attribute is present the DOM would not load the XML - producing the &quot;...out of context&quot; error (the dt namespace is declared but I did not included it in my example). I can get around this problem by removing the dt attribute but would like to understand why this is occurring and maybe come up with a better solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top