473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Disappearing namespace

Hi,
I am asking this here in addition to the vstools.office group because i
think the issue could possibly be schema or serilazation related...

i have a word document which has a custom schema attached whose target
namespace is "com.test.mynamespace". I am trying to insert some xml
into the word document using Range.InsertXML. I get the xml to insert
by serializing an object. the xml after serialization of my object
looks like this:
<data xmlns:ts="com.test.mynamespace">
<people>
<person id="1234">
<ts:name>Test User</ts:name>
<ts:email>emailaddr1</ts:email>
</person>
<person id="5678">
<ts:name>Test User1</ts:name>
<ts:email>emailaddr2</ts:email>
</person>
</people>
<places>
<place id="1234">
<ts:name>Somewhere 1</ts:name>
</place>
<place id="5678">
<ts:name>Somewhere2</ts:name>
</place>
</places>

So the first question is why after serializing my object, does certain
elements have a prefix, and others don't?

The second issue is, after inserting the above XML into my Word
document, i look at the underlying WordML and the xml i inserted looks
like this (note, i am not showing the superfluous WordML that surrounds
the nodes for clarity
sake):

<data>
<person >
<person id="1234">
<ns2:name>Test User</ns2:name>
<ns2:email>emailaddr1</ns2:email>
</person>
<person id="1234">
<ns2:name>Test User</ns2:name>
<ns2:email>emailaddr2</ns2:email>
</person>
</people>
<places>
<place id="1234">
<ns2:name>Somewhere 1</ns2:name>
</place>
<place id="1234">
<ns2:name>Somewhere2</ns2:name>
</place>
</places>
All elements are valid and in my schema.
Notice that the namespace is gone from the top level element, but that
an "ns2" alias is added to some elements. "ns2" is an alias for my
name space in the Word document. But i don't understand why only some
elements are marked as "ns2" (equivalent to the "ts" alias)...My
question is, why is the top level namespace being thrown out? This is
creating difficulties in transforming this xml, as my stylesheet is
unable to find the "data" element.

Any help would be appreciated and i can provide more details as
necessary (i realize it is a long post already, so i have left out the
code and shema definition for now)

Nov 17 '05 #1
0 915

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: baylor | last post by:
I'm having a weird bug and wondering if anyone has ever seen this before A Hello World GUI app. Create an app.config. When you build, Studio copies app.config to bin\debug\ and renames it to the...
3
by: Harry Keck | last post by:
I am trying to create an xsl stylesheet on the fly as an xml document. I create elements of type "xsl:value-of" and insert them into my document, but when I output the xml representation of the...
0
by: farseer | last post by:
Hi, I am asking this here in addition to the vstools.office group because i think the issue could possibly be schema or serilazation related... i have a word document which has a custom schema...
3
by: baylor | last post by:
I'm having a weird bug and wondering if anyone has ever seen this before A Hello World GUI app. Create an app.config. When you build, Studio copies app.config to bin\debug\ and renames it to the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.