# DiffResult.printChangeLog generates xmlns="" at each element

**URL:** <https://forum.liquibase.org/t/diffresult-printchangelog-generates-xmlns-at-each-element/1460>\
**Category:** Liquibase Development\
**Created:** [November 27, 2010, 2:14pm UTC](https://forum.liquibase.org/t/diffresult-printchangelog-generates-xmlns-at-each-element/1460 "2010-11-27T14:14:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cshark](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@cshark](https://forum.liquibase.org/u/cshark)\
**Post date:** [November 27, 2010, 2:14pm UTC](https://forum.liquibase.org/t/diffresult-printchangelog-generates-xmlns-at-each-element/1460/1 "2010-11-27T14:14:00Z")

</div>

I’m trying to use Liquibase embedded in code.  
The DOM document builder is Xerces. (I guess this is the default)  
The (identity) transformer from XMLDefaultXMLWriter that serializes to a PrintStream or file is Saxon 9.2.1 (this is probably not the default, it’s used in my code; haven’t tried with the default)  
Using Java 6  
Using Liquibase code snapshot 2.0RC8

DiffResult.printChangeLog generates xmlns="" at each element in the output xml; which invalidates the xml of the changelog file.

\<?xml version="1.0" encoding="UTF-8"?\> http://www.liquibase.org/xml/ns/dbchangelog" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance"](http://www.w3.org/2001/XMLSchema-instance%22) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xsi:schemaLocation="[http://www.liquibase.org/xml/ns/dbchangelog](http://www.liquibase.org/xml/ns/dbchangelog)[http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd"\>](http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd%22>)

I’ve been trying to workaround this validation issue; and found one way to achieve this; that is to replace the calls createElement(“databaseChangeLog”); by createElementNS(“[http://www.liquibase.org/xml/ns/dbchangelog”,](http://www.liquibase.org/xml/ns/dbchangelog%22,) “databaseChangeLog”); (in both DiffResult and XMLChangeLogSerializer)

to make those xml elements namespace aware.

This solved the issue of the xmlns="" for me. The xmlns="" are no longer present; and the xml is now validating.

I’m new to liquibase but trying to find my way through it. Not sure if this was a bug or not; and whether this is a bugfix.  
Feedback is welcomed.

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [November 27, 2010, 2:14pm UTC](https://forum.liquibase.org/t/diffresult-printchangelog-generates-xmlns-at-each-element/1460/2 "2010-11-27T14:14:00Z")

</div>

It has worked with the default XML parser, but I’ll commit the change so it works with yours as well.

Nathan

---

<div class="post-metadata">

**Author:** ![cshark](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@cshark](https://forum.liquibase.org/u/cshark)\
**Post date:** [November 27, 2010, 2:14pm UTC](https://forum.liquibase.org/t/diffresult-printchangelog-generates-xmlns-at-each-element/1460/3 "2010-11-27T14:14:00Z")

</div>

Great !  
Thanks
