none
[Bug]: Repeating Section Content Control (Word 2013) and additional namesapces in Custom XML Part RRS feed

  • Question

  • Hello.

    I try to generate Word document based on Content Controls mechanism in Word 2013.

    I created document with Repeating Section CC (around table cell) and some simple contet control internally. All CCs i maped to XML Part.

    <?xml version="1.0" encoding="utf-8"?>
    <test xmlns="urn:Test" attr1="" attr2="">
    	<repeatedTag attr="" />
    </test>

    (Repeating Section map on <repeatedTag> and internal Plain Text on @attr).

    I tried to change Xml part content (add real data to generate document).

    If i insert this XML

    <?xml version="1.0" encoding="utf-8"?> <test xmlns="urn:Test" attr1="1" attr2="2"> <repeatedTag attr="1" /> <repeatedTag attr="2" /> <repeatedTag attr="3" /> </test>

    - all work correct.

    But if i add additional namespace declaration in XML i get starnge result:
    1. In this variant:

    <?xml version="1.0" encoding="utf-8"?>
    <test xmlns="urn:Test" attr1="1" attr2="2" xmlns:t="urn:TTT">
    	<repeatedTag attr="1" />
    	<repeatedTag attr="2" />
    	<repeatedTag attr="3" />
    </test>

    also work OK.

    2. But in this variant:

    <?xml version="1.0" encoding="utf-8"?>
    <test xmlns:t="urn:TTT" xmlns="urn:Test" attr1="1" attr2="2">
    	<repeatedTag attr="1" />
    	<repeatedTag attr="2" />
    	<repeatedTag attr="3" />
    </test>

    (additional namespace "urn:TTT" declare before general "urn:Test") - map only first <repeatedTag>! And my report contain only one table row!

    I use standard .Net serializer and can't control namespace declaration in result XML. How can I decide this problem?

    All 3 sample document i share in SkyDrive http://sdrv.ms/IZ4nHU (RepeatingSectionBug.zip)
    Saturday, December 7, 2013 1:23 PM

All replies

  • Hello Michail,

    I would recommend you to post bug reports to the Microsoft Connect web site instead.

    Saturday, December 7, 2013 1:52 PM
  • Eugenue, thank you.

    But I found only Office Document Themes Designer. Can you promt me, where can I send report bug for MS Office?

    Monday, December 9, 2013 5:31 AM
  • Hi Mihail

    Could you please test whether adding an alias to the default namespace and using this in the xml works properly? Historically, Word has problems with namespaces without aliases, which is why I make the suggestion.

    <?xml version="1.0" encoding="utf-8"?>
    <x:test xmlns:t="urn:TTT" xmlns_x="urn:Test" x:attr1="1" x:attr2="2">
    	<x:repeatedTag x:attr="1" />
    	<x:repeatedTag x:attr="2" />
    	<x:repeatedTag x:attr="3" />
    </x:test>


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, December 9, 2013 7:20 AM
    Moderator
  • Michail,

    You are right, there is no hive for submitting Office bugs. However, you can try adding a new one to the mentioned hive. May be then they will consider creating a new hive for Office applications :)

    Monday, December 9, 2013 11:31 AM
  • Cindy, thank you for you interest

    Sadly, but your hypothesis is not confirmed :(

    This variant work very well:

    <?xml version="1.0" encoding="utf-8"?>
    <x:test xmlns:x="urn:Test" attr1="1" attr2="2" >
    	<x:repeatedTag attr="1" />
    	<x:repeatedTag attr="2" />
    	<x:repeatedTag attr="3" />
    </x:test>

    But this doesn't work:

    <?xml version="1.0" encoding="utf-8"?>
    <x:test xmlns:t="urn:TTT" xmlns:x="urn:Test" attr1="1" attr2="2" >
    	<x:repeatedTag attr="1" />
    	<x:repeatedTag attr="2" />
    	<x:repeatedTag attr="3" />
    </x:test>

    I found one workaround for my application - I supress emiting additional namespces in standard .Net XmlSerializer, but it doesn't always work and It's not very safe method.

    P.S. Sorry Cindy, may be you know how send report for Office/Word team?

    Monday, December 9, 2013 11:38 AM
  • Hi Mihail

    I'm a bit short on time until after a seminar on Wednesday. I'd like to research this further, but can't until the end of the week.

    Could you, in the meantime, provide a reproducible scenario / set of steps? Not only for my personal use, if you take my meaning...


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, December 10, 2013 9:18 AM
    Moderator
  • Mihail,

    I have just met the following pages on my way, may be you will find them useful:

    However, I suppose Cindy may contact Office/Word developers directly. Am I right, Cindy?



    Tuesday, December 10, 2013 2:19 PM
  • Hi Eugene

    <<However, I suppose Cindy may contact Office/Word developers directly. Am I right, Cindy>>

    Not really, no - I'm not that important :-) I know some individuals to whom I can sparingly (i.e. not wear out my welcome) pass well-documented and 100% reproducible incidents. What happens after that depends on what the individual does with it. All totally inofficial; there's no guarantee something will actually get looked at or put in the database.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, December 10, 2013 5:07 PM
    Moderator
  • Eugene, many thanks

    But I can't find for for bug submit. Your second link it's form for site problem feedback only (how I understood).

    I send request for access on Microsoft Connect but now my request is not complete.

    Thank you, that you try to help me!

    Saturday, December 14, 2013 8:45 AM
  • >> Could you, in the meantime, provide a reproducible scenario / set of steps

    Yes, of course.

    1. Create Word document

    2. Open Developer tab, open XML Mapping Pane and add some XML with repeated tags. For example you can use this

    <?xml version="1.0" encoding="utf-8"?>
    <test xmlns="urn:Test">
    	<repeatedTag attr="" />
    </test>

    3. Create table in document

    4. Round table cell in Repeating section content control and map this section on <repeatedTag>

    5. Insert Plain text content control internal repeating section and mpa it on @attr attribute.

    6. Close Word

    7. Open created document as zip-container, and change \customXml\item1.xml part on

    <?xml version="1.0" encoding="utf-8"?>
    <test xmlns="urn:Test">
    	<repeatedTag attr="AAA" />
    	<repeatedTag attr="BBB" />
    	<repeatedTag attr="CCC" />
    </test>

    8. Reopen document document in Word - you shold see table with 3 rows (AAA, BBB and CCC)

    9. Close Word, and change \customXml\item1.xml on

    <test xmlns:xi="http://www.w3.org/2001/XInclude" xmlns="urn:Test">
    	<repeatedTag attr="AAA" />
    	<repeatedTag attr="BBB" />
    	<repeatedTag attr="CCC" />
    </test>

    In Word you will see table with only one first row (AAA).

    10. Third experiment: \customXml\item1.xml on

    <?xml version="1.0" encoding="utf-8"?>
    <test xmlns="urn:Test" xmlns:xi="http://www.w3.org/2001/XInclude">
    	<repeatedTag attr="AAA" />
    	<repeatedTag attr="BBB" />
    	<repeatedTag attr="CCC" />
    </test>

    (addition namspace declaration insert after main).

    In Word you will see correct table with 3 rows!

    Saturday, December 14, 2013 9:10 AM
  • Mihail,

    Actually, I was in your shoes many times trying to reach somebody among Office developers or technical support representatives.

    Anyway, please keep us informed. May be in the future this thread will help others.

    Saturday, December 14, 2013 9:56 AM