Hi Roland,

On Tue, Sep 30, 2014 at 5:35 PM, rol <[email protected]> wrote:
> Hello,
>
> I want to do a bulk import of some 80 wiki pages (i.e. files) in xwiki 2.1
> syntax to an xwiki instance.
>
> However, in the input there is some xml within {{code}}...{{/code}} sections
> which creates trouble.
>
> The following xml markup:
>
> {{code}}
>   <property as="xs:anyURI" name="oxf.fr.detail.send.success.uri.*.*"
>     value="http://localhost:8080/site/mycases/form/confirmdispatcher"/>
> {{/code}}
>
> causes the parser to derail. To prevent this from happening, I must
> substitute the '<' and '>' with
> &lt; and &gt; respectively.
>

> However, when pasting exactly the same code directly into the xwiki-editor
> in source mode the content is
> parsed correctly.

The content is not the only information that a wiki page has. It also
has a title, a parent, an author, a creation date, etc. When you
export a wiki page (but it applies to import too) all this information
ends up in a single XML document so each (meta)data must be
XML-encoded to prevent it from interfering with the XML tags used to
describe (mark) them.

<xwiikidoc>
  <title>XML encoded title</title>
  <content>XML encoded content</content>
  ...
</xwikidoc>

When you edit the content of a wiki page using the wiki editor (source
mode) the content is obviously decoded (otherwise it would have been a
pain to edit).

Hope this helps,
Marius

>
> Is there any better way to solve this problem than to pre-process all
> xwiki-2.1 files and perform the necessary substitutions
> within code sections such as above?
>
> BTW I used a scriptified version of the following command for the operation:
>
> curl -u Admin:admin -X PUT --data-binary "@input.xml" -H "Content-type:
> application/xml" -H "Accept: application/xml"
> http://wiki.motrice.org/xwiki/rest/wikis/xwiki/spaces/Motrice/pages/NewPage
>
> Best regards,
> Roland
>
>
>
>
>
>
> --
> View this message in context: 
> http://xwiki.475771.n2.nabble.com/Rest-API-XML-and-Xwiki-syntax-interference-tp7592473.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to