wordpress hit counter
Welcome to OpenXML Developer Sign in | Join | Help

How to Validate Custom XML Markup which is embeded within wordprocessingML?

Last post 06-19-2009, 12:57 PM by Xiaoyuvax. 6 replies.
Sort Posts: Previous Next
  •  05-20-2009, 12:04 PM 4678

    How to Validate Custom XML Markup which is embeded within wordprocessingML?

    I created a schema and is ready to implement this schema as customXml Markup within a wordprocessingML maindocument part, the problem is how can i validate those customXML markups with my schema?

     

     


    Welcome to visit my Blog:xiaoyuvax.spaces.live.com
    Follow me on Twitter: twitter.com/xiaoyuvax
  •  05-22-2009, 5:19 AM 4684 in reply to 4678

    Re: How to Validate Custom XML Markup which is embeded within wordprocessingML?

    since it's custom, SDK provides no functionality to validate it.

    I'm just curious, you should make sure the markup is generated following your own schema. Why do you need to validate them? Other people can generate the markup? Thanks!

  •  05-31-2009, 5:54 AM 4748 in reply to 4684

    Re: How to Validate Custom XML Markup which is embeded within wordprocessingML?

    yes, my custom xml may be read & generated by different apps,such as an aspx page which may be often modified and requires a neat code, and has a relatively complex structure and restrictions must be carefully handled. now it seems that one thing that i can do is to extract and translate those custom "xml markups" into a real XML DOM and validate it with my schema, and then go back to process the embedded inner contents within these markups. It's a boring thing...

    a customXml Markup validation mechanism may suggest a transparent view of the customXML content which is embedded within the wordprocessingML,i think it may be important to facilitate inter-operation among multiple schemas, as may be a funny architecture, if such a mechanism(with extended model and functionality) is provided directly from the SDK.

    I would be pleased to see a model amendment be appended to the SDK with customXML markup validation and customDOM support, when the developers could operate XML within XML while these XMLs are actually isolated by <customXML> simply(rather than being put into an isolated part) and meanwhile sharing contents with wordprocessingML as well. Let's call it what? 3D XML or noodle XML? lol, anyway it's worthy of discussing...

    My point is: Since it's Custom,it shall be FREE,while since it's XML,it shall be well-managed & validated. Don't leave wild grass growing in the corner which is built under the name of the decent XML. Otherwise, why customXML?


    Welcome to visit my Blog:xiaoyuvax.spaces.live.com
    Follow me on Twitter: twitter.com/xiaoyuvax
  •  06-03-2009, 9:04 AM 4815 in reply to 4748

    Re: How to Validate Custom XML Markup which is embeded within wordprocessingML?

    Hi Xiaoyuvax,

    Your thoughts are very interesting, I'll think about it and discuss with you later maybe:)

    There's another thing I'm curious about is how do you use the validation feature. are you use it after you generate the document, or needs to validate the document/part in debugging mode? How should the error message help you to locate the errors in the documents? Thanks:)

  •  06-15-2009, 11:16 AM 6122 in reply to 4815

    Re: How to Validate Custom XML Markup which is embeded within wordprocessingML?

    Not debugging Mode, but in real application. Think about an aspx page that reads data from CustomXML markups within a part in a DocX file uploaded. The page needs firstly validate those customXML markups within the part, and then parse them together into a DOM for latter operations(if the customXML structure is kindof complex and requires constraints verification), rather than just extract those lines out and parse them as plain strings.

    I would expect to validate the customXML markups at these occasions:

    1) After the wordprocessML within a part is validated(that shows this part is ready for use), i would like to assure the CustomXML is legal and sound for use in another dimension.

    2) Before I'd like to retrieve the data, maybe a node or a collection of nodes,i would like to reassure these nodes are all OK,so that i could process only these fractions of REAL xml contents.(which means the validation can be applied to parts of XML as well which provides better flexibility)

    3) After Generation, validation may provides better output,but is not compulsory,for the generator shall be designed and debugged to be compatiable with the schema,otherwise it's sheerly the problem of the programmer. i.e. Validation,it's mostly the reader-side problem.


    point 2) provides certain hints to the methodology for efficiently locating errors, the code could shrink the range for validation, as it may split the context into fractions to be validated separately according to certain divisions from wordprocessML,such as paragraph,sections.
    Welcome to visit my Blog:xiaoyuvax.spaces.live.com
    Follow me on Twitter: twitter.com/xiaoyuvax
  •  06-18-2009, 2:39 AM 6606 in reply to 6122

    Re: How to Validate Custom XML Markup which is embeded within wordprocessingML?

    Hi there,

    The current validation feature with CTP2 can validate a whole package, part, element, also document in string or stream. To narrow down the validation scope is one way, the other is how to provide sufficient/effective infomation to locate the errors, what you mentioned as well. Is the XPath information of the errors helpful to you? I fyou use validation during debugging, I don't think it's important, right?

    My understanding of your requirements of extending validation is 1) validate custom XML markup together with WordprocessingML; 2) validate part of the custom XML markup. Is that right?

    Besides, I'm interested in your "later operations" in your description. what kind of manipulations are you doing on the documents? what kind of solution are you building around SDK? what's your user scenario? what's the content in the documents ? how are the final documents used typically (send/email, print, view, download, archive...)? are you using some other technologies (sharepoint, silverlight, vsto...)? any feedback is welcome. 

  •  06-19-2009, 12:57 PM 6682 in reply to 6606

    Re: How to Validate Custom XML Markup which is embeded within wordprocessingML?

    Concerning my solution,i've replied and briefly explained in another post : http://openxmldeveloper.org/forums/thread/5424.aspx, don't know if you have checked it out.

    Your understanding of requirements of extending validation: the point 1) is not exactly what i want.

    I would like to validate CustomXml markups separately,whenever data saved within these markups are needed to be processed,but not together with WordprocessML(at one time when wML is validated). while WordprocessingML is validated on its own way(for customXMLs are not necessary for Word to see). The standard wordprocessingML parser may see these markups as void. and the CustomXML markups parser may also see wordprocessingML as pure data. i.e. They validate independently respectively and asynchronously.

    They are separate models and systems, as if they were two xml files. but the only intricate and interesting thing is they share the common part of data embraced within the Tag. This is like parellel universes in SF that scientists found the intersection of two universes (remember the film by Jet Lee? lol). In fact these two XML files have different "Namespaces"(got some hints about the similarity with the SF?). They INTERSECT with eachother,but from different namespaces - I want that effects,and it is a perfect philosophy and i think it might work some good for us,within the world of XML and especially OOXML


    XPath information is surely useful somehow as long as the information may provide clue to shrink the range of further validation(i have no much experience with XPath so far, but maybe later, and will figure it out then perhaps),and i think mostly during run-time in real deployment, the application may just discard the part of CustomXMLMarkups section which is validated as error with a shrinking validation and finally locate the error to the minimal extend(or to a reasonable extend) ,and the rest part of data may still be valid for user access.

    Since .net framework has offered such feature to disable those faulty codes and modules as to let program go on execution,and why not just make XML validation act the same way.

    Welcome to visit my Blog:xiaoyuvax.spaces.live.com
    Follow me on Twitter: twitter.com/xiaoyuvax
View as RSS news feed in XML