how to print newline in xml?

anatoli.barski at googlemail.com anatoli.barski at googlemail.com
Thu Jun 1 03:04:26 EDT 2006


Thank you for a possible solution, but it's not what I'm looking for,
cause something like <!-- comment --> would look quite similar... for
big elements like robot it would be ok to use comment as a child of
element - but imagine I'd like to comment transformation:

<transformation x="0" y="0" z="0"/> I wouldn't like to make this
element parent of a description - it is not nice - I have lots of such
elements.

It is important that a user after having a glance at the document is
able to quickly find and change some values. I don't want to bother him
with reading documentation nodes - but if he needs - they should be
there... the only possible solution I can think of would be:

<Robot>
  <verbose mode="enabled"/>                    <!-- enabled, disabled
-->
  <CollisionChecker type="vcollide"/>          <!-- possible values for
type: vcollide, (nyi: disabled) -->
  <Visualisation mode="3DModel"/>              <!-- posiible values for
mode: 3DModel, (nyi: disabled, line) -->

<!--  <Offset eulerX="-90" eulerZ="90"/> -->

  <RootJoint>                                  <!-- the one and only
root joint -->
    <Name value="Armar3"/>                    <!-- name of this joint
-->
    <DH>                                       <!-- Denavit Hartenberg
parameters -->
      <alpha value="0"/>
    </DH>

    <ID value="0"/>                            <!-- unique ID of this
joint -->
    <ChildNodes childID="1"/>                  <!-- all child joints of
this joint -->
  </RootJoint>

  <ChildJoint>
    <Name value="Platform"/>
    <JointTransformation>
      <RotationAxis X="0" Y="0" Z="1" INIT="0"/>
      <TranslationFromParent X="0" Y="0" Z="0"/>
    </JointTransformation>
    <Visualisation>                           <!-- visualisation
settings for this joint -->
      <IVModel file="model/platform.iv"/>      <!-- filename of full 3d
model -->
    </Visualisation>
    <ID value="1"/>                             <!-- unique ID of this
joint -->
    <ChildNodes childID="2"/>                  <!-- all child joints of
this joint -->
  </ChildJoint>

> How about:
>
> <robot>
>     <description>armar3</description>
>     :
>     :
> </robot>
>
> XML editor + xpath makes this way more easier to use by humans compared to
> normal comments. Also, if you declare several of comment elements
> (summary, description, author, etc.) you can auto generate documentation
> etc.
>
> --
> John                               MexIT: http://johnbokma.com/mexit/
>                            personal page:       http://johnbokma.com/
>         Experienced programmer available:     http://castleamber.com/
>             Happy Customers: http://castleamber.com/testimonials.html




More information about the Python-list mailing list