<node id="1049" version="808a2aad-3666-49ce-8e8f-0b53a9c1800f" parentID="1048" level="2" writerID="0" nodeType="1046" template="0" sortOrder="0" createDate="2008-06-01T23:12:54" updateDate="2012-10-02T15:31:38" nodeName="My Node" urlName="mynode" writerName="Administrator" nodeTypeAlias="SomeType" path="-1,1048,1049">
<data alias="navigation-breadcrumbs">1</data>
<data alias="on-public-menu">1</data>
<data alias="on-suppliers-menu">0</data>
<data alias="headline-breadcrumbs">1</data>
<data alias="on-members-menu">0</data>
<data alias="menu-option-hide">0</data>
<data alias="page-name"/>
<data alias="body-copy">
<![CDATA[
<p><img src="/media/174164/sign_200x133.jpg" width="200" height="133" alt="Sign" style="float: right;"/>Consider it a divorce. What killed the dinosaurs? The ice age. Give you a lift? Hey, I'm a police officer. This is an arrest. I'm a cop you idiot! I'm detective John Kimble. This man is under arrest. No sequel for you. Only pain. When the governor get's here, call me. Just bodies. Take it BACK. Give you a lift? Excuse me. Don't disturb my friend. He's dead tired. Take your toy back to the carpet. Get to the choppa. I've seen you before. You're the asshole on TV. Como esta. I'm the party pooper. Hey, I'm a police officer. This is an arrest. I'm a cop you idiot! I'm detective John Kimble. This man is under arrest. I have my orders. You should not drink and bake. You are not sending ME to the coola. Put the cookie down. Now!</p>
<p><a href="/{localLink:1067}" title="Collaboration">Read
more<br />
</a></p>
]]>
</data>
<data alias="menu-option-lesser">0</data>
</node>
What do I call to convert this back to a CMSNode or Content Node? Something like...
I don't think you can go from Xml to CMSNode. You can go the other way by calling cmsNode.ToXml(...) but there doesn't look to be an alternative method for the other way.
Your problem aswell is the CMSNode is pretty much read only, so it doesn't look like you can create a CMSNode and populate it with the values.
What is it you need this for? maybe there is another way to do it.
Conversion of XML back into CMSNode or Content
Given that I have a node in XML form, such as;
<node id="1049" version="808a2aad-3666-49ce-8e8f-0b53a9c1800f" parentID="1048" level="2" writerID="0" nodeType="1046" template="0" sortOrder="0" createDate="2008-06-01T23:12:54" updateDate="2012-10-02T15:31:38" nodeName="My Node" urlName="mynode" writerName="Administrator" nodeTypeAlias="SomeType" path="-1,1048,1049"> <data alias="navigation-breadcrumbs">1</data> <data alias="on-public-menu">1</data> <data alias="on-suppliers-menu">0</data> <data alias="headline-breadcrumbs">1</data> <data alias="on-members-menu">0</data> <data alias="menu-option-hide">0</data> <data alias="page-name"/> <data alias="body-copy"> <![CDATA[ <p><img src="/media/174164/sign_200x133.jpg" width="200" height="133" alt="Sign" style="float: right;"/>Consider it a divorce. What killed the dinosaurs? The ice age. Give you a lift? Hey, I'm a police officer. This is an arrest. I'm a cop you idiot! I'm detective John Kimble. This man is under arrest. No sequel for you. Only pain. When the governor get's here, call me. Just bodies. Take it BACK. Give you a lift? Excuse me. Don't disturb my friend. He's dead tired. Take your toy back to the carpet. Get to the choppa. I've seen you before. You're the asshole on TV. Como esta. I'm the party pooper. Hey, I'm a police officer. This is an arrest. I'm a cop you idiot! I'm detective John Kimble. This man is under arrest. I have my orders. You should not drink and bake. You are not sending ME to the coola. Put the cookie down. Now!</p> <p><a href="/{localLink:1067}" title="Collaboration">Read more<br /> </a></p> ]]> </data> <data alias="menu-option-lesser">0</data> </node>
What do I call to convert this back to a CMSNode or Content Node? Something like...
I don't think you can go from Xml to CMSNode. You can go the other way by calling cmsNode.ToXml(...) but there doesn't look to be an alternative method for the other way.
Your problem aswell is the CMSNode is pretty much read only, so it doesn't look like you can create a CMSNode and populate it with the values.
What is it you need this for? maybe there is another way to do it.
Matt
Ok, best I could suggest is actually create a Document entity and populate that manually with the values from the XML, so maybe something like:
This is untested though
Matt
Hmm you can convert it to umbraco.NodeFactory.Node if you want too. Example:
This example might also help: http://our.umbraco.org/wiki/reference/code-snippets/add-fake-property-to-a-content-node.
Jeroen
Hey thanks for both of these replies!
@Matt - I was going down that route of creating a document e.g.
@Jeroen - I'll try call with the NodeFactory, I think that's actually what I'm after!
is working on a reply...