AuthorSchemaManager for validating AuthorDocumentFragments
Posted: Thu Nov 08, 2012 9:31 pm
Hello,
I want to check, if a certain XML String can be inserted at a certain location.
To insert a XML String schema aware you can easily use ro.sync.ecss.extensions.api.AuthorDocumentController.insertXMLFragmentSchemaAware(String, int);
But how can I just check if a certain XML String may be inserted according to schema rules?
I tried to use the ro.sync.ecss.extensions.api.AuthorSchemaManager.canInsertDocumentFragment(AuthorDocumentFragment, int, short)
method, but I cannot figure out how to create an ro.sync.ecss.extensions.api.node.AuthorDocumentFragment from a XML String.
When I use the ro.sync.ecss.extensions.api.AuthorDocumentController.createNewDocumentTextFragment(String) method to create an AuthorDocumentFragment the canInsertDocumentFragment always returns true, even thought if the element actually is not allowed.
Can you please give me a hint how I can check if a certain xml string is allowed at a certain offset?
With xml String I mean something like this : <image href="test.jpg" />
Best regards,
Simon
I want to check, if a certain XML String can be inserted at a certain location.
To insert a XML String schema aware you can easily use ro.sync.ecss.extensions.api.AuthorDocumentController.insertXMLFragmentSchemaAware(String, int);
But how can I just check if a certain XML String may be inserted according to schema rules?
I tried to use the ro.sync.ecss.extensions.api.AuthorSchemaManager.canInsertDocumentFragment(AuthorDocumentFragment, int, short)
method, but I cannot figure out how to create an ro.sync.ecss.extensions.api.node.AuthorDocumentFragment from a XML String.
When I use the ro.sync.ecss.extensions.api.AuthorDocumentController.createNewDocumentTextFragment(String) method to create an AuthorDocumentFragment the canInsertDocumentFragment always returns true, even thought if the element actually is not allowed.
Can you please give me a hint how I can check if a certain xml string is allowed at a certain offset?
With xml String I mean something like this : <image href="test.jpg" />
Best regards,
Simon