Answer the question
In order to leave comments, you need to log in
How to add new element in xml?
Prompt, I receive xml in which I need to add a new element. How to do it?
getting it
<User xmlns="http://www.vmware.com/vcloud/v1.5" name="admin" id="urn:vcloud:user:3284020b-12b3-4e39-9096-9b7c0556f21b" href="https://example.com/api/admin/user/3284020b-12b3-4e39-9096-9b7c0556f21b" type="application/vnd.vmware.admin.user+xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://example.com/api/v1.5/schema/master.xsd">
<Link rel="edit" href="https://example.com/api/admin/user/3284020b-12b3-4e39-9096-9b7c0556f21b" type="application/vnd.vmware.admin.user+xml"/>
<Link rel="takeOwnership" href="https://example.com/api/admin/user/3284020b-12b3-4e39-9096-9b7c0556f21b/action/takeOwnership"/>
<FullName/>
<EmailAddress/>
<Telephone/>
<IsEnabled>true</IsEnabled>
<IsLocked>false</IsLocked>
<IM/>
<NameInSource>admin</NameInSource>
<IsAlertEnabled>false</IsAlertEnabled>
<IsExternal>false</IsExternal>
<ProviderType>INTEGRATED</ProviderType>
<IsDefaultCached>false</IsDefaultCached>
<IsGroupRole>false</IsGroupRole>
<StoredVmQuota>0</StoredVmQuota>
<DeployedVmQuota>0</DeployedVmQuota>
<Role href="https://example.com/api/admin/role/a08a8798-7d9b-34d6-8dad-48c7182c5f66" name="Organization Administrator" type="application/vnd.vmware.admin.role+xml"/>
<GroupReferences/>
</User>
<password>123456</password>
<User xmlns="http://www.vmware.com/vcloud/v1.5" name="admin" id="urn:vcloud:user:3284020b-12b3-4e39-9096-9b7c0556f21b" href="https://example.com/api/admin/user/3284020b-12b3-4e39-9096-9b7c0556f21b" type="application/vnd.vmware.admin.user+xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://example.com/api/v1.5/schema/master.xsd">
<Link rel="edit" href="https://example.com/api/admin/user/3284020b-12b3-4e39-9096-9b7c0556f21b" type="application/vnd.vmware.admin.user+xml"/>
<Link rel="takeOwnership" href="https://example.com/api/admin/user/3284020b-12b3-4e39-9096-9b7c0556f21b/action/takeOwnership"/>
<password>123456</password>
<FullName/>
<EmailAddress/>
<Telephone/>
<IsEnabled>true</IsEnabled>
<IsLocked>false</IsLocked>
<IM/>
<NameInSource>admin</NameInSource>
<IsAlertEnabled>false</IsAlertEnabled>
<IsExternal>false</IsExternal>
<ProviderType>INTEGRATED</ProviderType>
<IsDefaultCached>false</IsDefaultCached>
<IsGroupRole>false</IsGroupRole>
<StoredVmQuota>0</StoredVmQuota>
<DeployedVmQuota>0</DeployedVmQuota>
<Role href="https://example.com/api/admin/role/a08a8798-7d9b-34d6-8dad-48c7182c5f66" name="Organization Administrator" type="application/vnd.vmware.admin.role+xml"/>
<GroupReferences/>
</User>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question