Personal tools
You are here: Home Documentation Tutorials XML in Plone with Marshall Getting and Editing XML
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Getting and Editing XML

Now that the ATXML marshaller is configured, let's work with it.

Paul Everitt

Marshall lets you save and load Plone content using XML. As a configurable system, it has lots of options. This hands-on how-to shows exactly what to do to make the basics work.
Page 4 of 6.

So good news, you already have reached a point of success!  Visit Plone's front-page in a browser and add manage_FTPget to the URL, as shown in the URL bar below:

Viewing XML from Marshal


Ahh, look at all that XML goodness, ain't she beautiful?  But can we edit an existing entry?  Let's use the cadaver command-line DAV tool and find out:

$ cadaver http://localhost:8880/atxml/
$ edit front-page

Note the usage of the WebDAV port number!!  Depending on your editor settings, the second command will give you an editor such as vi.  Change the value of the <dc:title> element, then save and exit the editor.  cadaver will send the changes to Plone and unlock the resource.

Re-open the Plone front page in a web browser.  You should see your new title.  Cool, eh?

Some notes on this:

  1. Eagle-eyed observers will note that the body field was, errm, how shall we say this....encoded. In the case of Marshall 0.6, if a field's contents are HTML, the Marshaller puts the content in a CDATA.  Why?  Because we can't promise that the HTML is well-formed XML.  Future versions of Marshall might revisit this policy.  Note that image and file field contents are currently not serialized.
  2. cadaver has a helpful readline mode, if your compilation supported it.
  3. This XML format is in flux!  Sidnei and I are discussing how to get more "meaning" out of Plone, in a way that fits the median of expectations.

I like using the oXygen editor, as noted above.  With oXygen I can open the Plone site, browse to front-page, and edit the content in a real XML editor.  I can even download the Relax NG schema for Marshall and validate before saving.

In this next screenshot, I show browsing the contents of the Plone site using oXygen's WebDAV browser:

oXygen Browsing

I double-click to open front-page and tell oXygen that this is an XML document (lack of file extension means it couldn't guess).  In the next screenshot, I have the front-page, exported as ATXML, open for editing.  I have changed the dc:title and I have also associated the Relax NG schema with this page, thus giving me the inspector on the right:

oXygen Changed


Finally, I show the schema validation in action.  I mistakenly change the id attribute on a field to be xid, which is not allowed in the schema.  Note the red underline, the completely accurate warning message in the status bar, and the appearance of the right-hand inspector pane:

oXygen Validator











 
by Paul Everitt last modified January 24, 2006 - 13:11
Contributors: Paul Everitt, Sidnei da Silva
All content is copyright Plone Foundation and the individual contributors.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by