# Generating xml with native field names and after build macro transformations

**URL:** https://community.haxe.org/t/generating-xml-with-native-field-names-and-after-build-macro-transformations/1094
**Category:** Haxe
**Tags:** haxe-xml
**Created:** [September 19, 2018, 11:59am UTC](https://community.haxe.org/t/generating-xml-with-native-field-names-and-after-build-macro-transformations/1094 "2018-09-19T11:59:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![RiemannX](https://community.haxe.org/user_avatar/community.haxe.org/riemannx/32/645_2.png) [@RiemannX](https://community.haxe.org/u/RiemannX)
#### Post date: [September 19, 2018, 11:59am UTC](https://community.haxe.org/t/generating-xml-with-native-field-names-and-after-build-macro-transformations/1094/1 "2018-09-19T11:59:10Z")

</div>

I’m doing some transformations with a build macro, and renaming some fields with the `@:native` metadata. For example

```haxe
@:native("AnotherName")
@:expose
class SomeClass {}

```

The generated JS output has this class named `AnotherName` rather than SomeClass. But it is represented in the generated xml as

```haxe
<class path="SomeClass" params="" file="SomeClass.hx">
    <meta>
        <m n=":native"><e>"AnotherName"</e></m>
        <m n=":expose"/>
    </meta>
</class>

```

While I need

```haxe
<class path="AnotherName" params="" file="SomeClass.hx">
</class>

```

Is there a way to do this?

---

<div class="post-metadata">

### Author: ![ibilon](https://community.haxe.org/user_avatar/community.haxe.org/ibilon/32/13_2.png) [@ibilon](https://community.haxe.org/u/ibilon)
#### Post date: [September 28, 2018, 9:38am UTC](https://community.haxe.org/t/generating-xml-with-native-field-names-and-after-build-macro-transformations/1094/2 "2018-09-28T09:38:42Z")

</div>

`@:native` changes the generated name, but the class (or field) still has its original name, which you use in your haxe code.  
That’s why the xml reflect this, it’s mainly used for documentation, where you want the haxe name.

You’ll have to either check for the presence of the meta in your application using the xml,  
or do a preprocess step with either custom code or something like [xslt](https://www.w3schools.com/xml/xsl_intro.asp).
