Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 07, 2010 @ 09:41
    Jeroen Breuer
    1

    Why a new XML Schema?

    Hello,

    In Umbraco 4.1 the XML Schema is new, but why has this been done? Is it faster when using XSLT? If I look at these examples the XSLT looks less readable. What are the main arguments for the new XML Schema?

    Jeroen

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Jun 07, 2010 @ 09:47
    Niels Hartvig
    7

    The new schema is faster and more well-defined. I think some of the samples in the wiki are harder than they look - I'll come with some feedback. When you start working with the new schema you'll also find that it's much easier to read and understand.

    The current very generic schema was one of the things that scared most new people away. With the new schema we're able to start having intellisense in Visual Studio, XMLSpy, etc, increase performance and readability. Of course it'll always take some time when you've gotten used to something else but we think it's the right way forward.

    This new schema will be the only one in v5 so we thought it was the best to start the transition now.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 07, 2010 @ 09:48
    Matt Brailsford
    4

    One argument is file size (which also negates to space taken up in memory) as the schema

    <myDocType>
      ...
    </myDocType>

    Takes up less space than

    <node nodeTypeAlias="myDocType">
      ...
    </node>

    Times that by a few thousand nodes, and thats a significant saving.

    Matt

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 07, 2010 @ 09:54
    Jeroen Breuer
    0

    Thanks for the explanation. Both answers are logically :).

    Jeroen

  • Yannick Smits 321 posts 718 karma points
    Jul 08, 2010 @ 00:43
    Yannick Smits
    0

    Is there a reason why the member classes didn't get upgraded to the new style?

  • Bryan 29 posts 50 karma points
    Jul 29, 2010 @ 11:58
    Bryan
    0

    Ok, this question will sound stupid but, where can I find the .xml file for my current scheme? I want to check it so I can use that to make my xpaths.

  • atze187 160 posts 215 karma points
    Jul 29, 2010 @ 12:17
    atze187
    0

    @Bryan: If I got you right, /data/umbraco.config should be what you're looking for...

  • Bryan 29 posts 50 karma points
    Jul 29, 2010 @ 13:03
    Bryan
    0

    Hey atze,

    Thats what I though(/found on the internet) but in my \data directory there is only 1 directory called "vistadb" which has a file named "_placeholder", no extension idd.

    So... yeah.. :D

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jul 29, 2010 @ 18:25
    Jeroen Breuer
    0

    In Umbraco 4.5 it's in App_Data/umbraco.config

  • Bryan 29 posts 50 karma points
    Jul 30, 2010 @ 17:25
    Bryan
    0

    Thats it Jeroen!

  • atze187 160 posts 215 karma points
    Jul 30, 2010 @ 18:57
    atze187
    0

    I knew I've seen it somewhere ;)

  • Wojciech Tengler 96 posts 199 karma points
    Aug 06, 2010 @ 10:06
    Wojciech Tengler
    0

    Hi Niels,

    I have one more idea how to decrease xml file size. When we go trough the xml file we can see that there are also empty properties.

    I think that document with empty property is the same like without this property.

    All is contained in Property.ToXml function when it is posible to test when the property is empty. For example:

    if(!string.IsNullOrEmpty(_data.Value.ToString()))
      x.AppendChild(_data.ToXMl(xd));
  • Wojciech Tengler 96 posts 199 karma points
    Aug 09, 2010 @ 11:05
    Wojciech Tengler
    0

    I thought about decreasing xml file size and I'm disappointed.

    In previous versions all property data have declaration:

    <data alias="propertyAlias">
    </data>

    Now in 4.5:

    <propertyAlias>
    </propertyAlias>

    It is simple way to count the character length in both solutions.
    Lets set the x variable like the propertyAlias length. Then we have two linear function which shows the total property "declaration" length:

    I: x + 22 = 0
    II: 2x + 5 = 0

    This function have own solution(point):

    x + 22 = 2x + 5
    x = 17

    So, when the propertyAlias length is more than 17 characters then the new schema contains more space.

    In my situation most of the propery aliases are longer than 17 characters...

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Sep 02, 2010 @ 16:36
    Niels Hartvig
    1

    If you worry about file sizes in KB in 2010 you're trying to identify a wrong issue :)

    In return for something that *might* take up a few extra bytes (let's say we have a site with 10.000 nodes, average of 10 properties per node and avg alias of 20, then it'll be 300kb extra data.or a 7% increase in *definition* size) compared to the ease of use of the new schema and the more stronger typing then I'd gladly have given away double (100%) in increase.

  • Wojciech Tengler 96 posts 199 karma points
    Sep 02, 2010 @ 17:05
    Wojciech Tengler
    0

    Thanks Niels,

    My umbraco.config file size is now 40MB, a I would like to import extra 6.000 nodes and I'm worying about Application Pool time to start and etc...

    I have another question:

    Could you tell me what methods are called when upgrading takes place to new xml schema? I think that in this transformation all published content is recreated and inserted to cmsContentXml.

    I removed some properties of published nodes and they are still in xml cache... So I would like to recreate cmsContentXml...

    What do you think about not saving empty properties to xml cache, it is possible?

Please Sign in or register to post replies

Write your reply to:

Draft