none
My issue regarding Custom XML going away RRS feed

  • Question

  • Before I start going into my problem, just to prefix that this is Open XML related.

    I have built a custom solution for us to generate template based documents.  I have included custom xml/schema to mark the sections of the document that are dynamically generated.  Dynamic content is in content controls of course.  For example:

    <w:customXml ...>
    my content here
    maybe a table or two with content controls,etc.
    couple of paragraphs
    </w:customXml>

    Imagine a cart with 10 items and content inside customXml gets repeated 10 time.  This is a simplified example of how I use it. 
    So I search for customXml, get all block elements inside it, clone them, look for content controls, replace them with dynamic values and insert before <w:customXml>.

    Now with customXml going away I am stuck trying to figure out what to use instead.  One option I thought of is to have a table with 2 columns that would have 1 column identifying it is a table I need to parse and second column would have my content that was inside customXml. 

    Anyway, any other suggestions to marking blocks of document that will allow me to search it and process it as in the example above?

    Thanks
    Wednesday, December 30, 2009 10:24 PM

Answers

  • Gray posted another blog on alternatives of custom xml markup: http://blogs.technet.com/gray_knowlton/archive/2010/01/04/using-content-controls-vs-custom-xml-elements.aspx

    In any case, other technologies you can use in this case:
    - Content Controls
    - bookmarks
    - Sections separated with styles (process in between styles)

    In addition I would recommend downloading Office 2010 Beta to see how your solution will work with these changes being made to Office.
    Zeyad Rajabi (MS)
    • Proposed as answer by Lu Zhang Thursday, January 7, 2010 6:19 AM
    • Marked as answer by vj9999 Saturday, January 9, 2010 4:08 AM
    Wednesday, January 6, 2010 4:18 AM
  • I was successful replacing customXml with nested sdtBlocks.  Thanks for a push in right direction.  I don't know why I never thought about nesting block content controls before.
    • Marked as answer by vj9999 Saturday, January 9, 2010 4:08 AM
    Saturday, January 9, 2010 4:08 AM

All replies

  • Hello Vj9999,

    I think what to be replaced in the customXML depends on what you concern and want to store and access later.

    For example, if you want to quickly get how many content controls in a specified table, then putting the content control count in a third column will work better. So actually, answers to this question are tightly related to your requirement and designation.


    Regards,
    Ji Zhou

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Thursday, December 31, 2009 8:58 AM
    Moderator
  • Ji Zhou,

    I'm not sure I understand your reply.  I am not concerend about using custom xml for storing data to be accessed later.  I am concerned with custom xml functionality that is going away due to i4i lawsuit.

    I use custom xml schema to mark sections of document that have a dynamic content.  I cannot just use content controls.  I use content controls for dynamic values that are inserted, but I use custom xml to specify the area of the document that will be dynamic.

    For example (in the document) it looks like:

    <items>
    <header>
    The following is list of items for this order
    -----------------------------
    |Qty| Part Number| Price|
    -----------------------------
    </header>
    <item>
    -----------------------------
    |Qty_contentcontrol| Part Number_contentcontrol| Price_contentcontrol|
    -----------------------------
    |Description_contentcontrol|
    -----------------------------
    </item
    <footer>
    |Total_contentcontrol|
    </footer>
    </items>

    So that is exactly what you see in the doc (with red marks for custom xml).  Currently what I do is search for w:customXml "items" than grab header, item, footer.  Process the content inside each (grab all block elements, clone them, process them for content controls). 

    This works great.  But I am now screwed since w:customXml as i am using it is going away.  I am searching for an alternative whay to mark a section of the document so that I can identify it and process it similar to what I do now.

    Anyone know an easy way to maybe have start block content control and end block content control and find all the elements between the 2?

    For example:
    start_contentcontrol
    bunch
    of
    paragraphs
    in between
    end_contentcotrol

    I am open to any suggestions.  I don't think I am the only person being faced with this issue.
    Monday, January 4, 2010 7:43 PM
  • Hi Vj9999,

    As for the impact of the i4i judgment on Word, please check on this link:

    http://blogs.technet.com/gray_knowlton/archive/2009/12/23/what-is-custom-xml-and-the-impact-of-the-i4i-judgment-on-word.aspx



    If you have any question after reading it, please us know.

    Thanks,

    Lu
    Tuesday, January 5, 2010 8:24 AM
  • Hi Lu,

    that article is what prompted me to ask my question in the first place.  All of my questions still remain after reading it.  Article only clarifies that the way I am using Custom Xml is going away and alternatives that is suggest do not fully work for me (using content controls instead - I am using content controls already).

    Again, I need a way to mark a section of the document to be processed dynamically (section of the document could contain static content and content controls).  Originally when I approached the issue custom schema/xml was the only way I managed to accomplish it.  Now with it going away I am left stranded looking for an alternative solution.

    Thanks
    Tuesday, January 5, 2010 12:52 PM
  • Gray posted another blog on alternatives of custom xml markup: http://blogs.technet.com/gray_knowlton/archive/2010/01/04/using-content-controls-vs-custom-xml-elements.aspx

    In any case, other technologies you can use in this case:
    - Content Controls
    - bookmarks
    - Sections separated with styles (process in between styles)

    In addition I would recommend downloading Office 2010 Beta to see how your solution will work with these changes being made to Office.
    Zeyad Rajabi (MS)
    • Proposed as answer by Lu Zhang Thursday, January 7, 2010 6:19 AM
    • Marked as answer by vj9999 Saturday, January 9, 2010 4:08 AM
    Wednesday, January 6, 2010 4:18 AM
  • Thanks Zeyad.

    After giving this alot more thought I think Content Controls are the way to go.I never thought of it this way since I had a reliable solution, but there is nothing stopping me form having nested sdtBlocks.

    So in my example above, I could have something like this:
    items sdtBlock
    --header sdtBlock
    ----header content (paragraphs, tables, etc.)
    --item sdtBlock
    ----item content (paragraphs, tables, etc.)
    --footer sdtBlock
    ----footer content (paragraphs, tables, etc.)

    I still have to give it some more thought, but I think I am finally moving in right direction.  I don't know why I never though of content controls as nestable objects.  Do you see any issue with the above approach?  I already created a sample document by hand and looked at it with Productivity Tool and it seems like it should work.

    Thanks
    Wednesday, January 6, 2010 6:03 AM
  • I was successful replacing customXml with nested sdtBlocks.  Thanks for a push in right direction.  I don't know why I never thought about nesting block content controls before.
    • Marked as answer by vj9999 Saturday, January 9, 2010 4:08 AM
    Saturday, January 9, 2010 4:08 AM