From e3aecf986093c13bec0f75f891ac8a18cfe71456 Mon Sep 17 00:00:00 2001 From: Christian Ledermann Date: Tue, 12 Nov 2024 17:51:32 +0000 Subject: [PATCH] fix doctest, skip validation for gx:CascadingStyle --- docs/working_with_kml.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/working_with_kml.rst b/docs/working_with_kml.rst index 2035b1ba..3da5942e 100644 --- a/docs/working_with_kml.rst +++ b/docs/working_with_kml.rst @@ -152,11 +152,14 @@ And register the new element with the KML Document object: The CascadingStyle object is now part of the KML document and can be accessed like any other element. -Now we can create a new KML object and confirm that the new element is parsed correctly: +When parsing the document we have to skip the validation as the ``gx:CascadingStyle`` is +not in the XSD Schema. + +Create a new KML object and confirm that the new element is parsed correctly: .. code-block:: pycon - >>> cs_kml = KML.parse("examples/gx_cascading_style.kml") + >>> cs_kml = KML.parse("examples/gx_cascading_style.kml", validate=False) >>> cs = find(cs_kml, of_type=CascadingStyle) >>> cs.style # doctest: +ELLIPSIS fastkml.styles.Style(... @@ -181,7 +184,7 @@ Now we can remove the CascadingStyle from the document and have a look at the re .. code-block:: pycon >>> document.gx_cascading_style = [] - >>> print(document.to_string(prettyprint=True)) + >>> print(document) Test2