gazebosim / gazebosim/sdformat

Get XML string from classes

Open
#468 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
216
Forks
125
Avg merge
1d 14h
Merged PRs (30d)
14

Description

The `sdf::Element` class has a convenient `ToString` function to output its contents as an XML string:

https://github.com/osrf/sdformat/blob/e8b30f0bca75c2861b0b21ca042706cc3c117b22/include/sdf/Element.hh#L158-L161

It would be convenient to be able to do the same for the DOM classes such as `sdf::Model`. If these classes have been loaded from an `sdf::Element`, it's possible to call `model.Element()->ToString("")`. But that's not the case if the class was created manually and doesn't have an element pointer.

Contributor guide

Open the contributing guide

Research direction

Start with the ToString declaration in include/sdf/Element.hh and compare it with the DOM classes such as sdf::Model. Determine how manually created classes should produce XML without an element pointer; done means the relevant DOM classes can return their XML representation in both loaded and manually constructed cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, xml
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.