Jump to content

Recommended Posts

Posted

Hi All,

This is purely an XML Language question. I need to understand how I can add a value/element in between another XML element. 

Code below shows the XML file. The info tag has the elements already inserted.

<Configuration xmlns="http://schemas.datacontract.org/2004/07/Modules.Reporting.DataContracts.LineItems" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <GenConf>
    <Info>ID, Site, Name , Site_ID</Info>
  </GenConf>
</Configuration>

Now, I want to add a value from a node group into this code. Something like below. But the example below does not work.

Any suggestions?
 

<Configuration xmlns="http://schemas.datacontract.org/2004/07/Modules.Reporting.DataContracts.LineItems" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <GenConf>
    <Info>ID, Site, a/@id, Name , Site_ID</Info>
  </GenConf>
</Configuration>


 <ProductName>
    <a id="Windows Server"/>
  </ProductName>

 

Kind Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

Posted

Did you check my XML.au3 UDF ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Hey there mLipok,

Basically, before even using Autoit, I want to know if the XML can reference a child node. 

So in future if I tell Autoit to change the child node, example, Windows Server changes to Windows OS, then the information node needs to also reflect that...

Making sense?

Kind Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

Posted

Yes... can reference... make sense.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  Quote

    2015/09/09
    "1.1.1.05"
    . NEW: ENUMs: $XMLWRAPPER_ERROR_PARSE_XSL - mLipok
    . NEW: ENUMs: $XMLWRAPPER_ERROR_NOATTRMATCH - mLipok
    . COMPLETED: Function: _XML_RemoveAttribute() - mLipok
    . NEW EXAMPLE: _Example_4__XML_RemoveAttribute() - mLipok
    . Renamed: _XMLReplaceChild >> _XML_ReplaceChild - mLipok
    . COMPLETED: _XML_ReplaceChild - mLipok
    . NEW EXAMPLE: _Example_5__XML_ReplaceChild() - mLipok
    . NEW: ENUMs: $XMLWRAPPER_ERROR_NOCHILDMATCH - mLipok
    . NEW EXAMPLE: _Example_6__XML_GetChildNodes() - mLipok
    . COMPLETED: _XML_GetChildNodes() - mLipok
    . COMPLETED: _XML_GetAllAttribIndex() - mLipok
    . NEW Function: _XML_Array_GetAttributesProperties() - mLipok
    . NEW EXAMPLE: _Example_7__XML_GetAllAttribIndex() - mLipok
    . ADDED: many IsObj() >> https://www.autoitscript.com/forum/topic/177176-why-isobj-0-and-vargettype-object/

Expand  

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Hi @mLipok

Grateful for your assistance with this. However I'm trying to make sure this is completely done in xml.
Something like this

<tag01>Marco</tag01>

<Product>
  <version>Polo</version>
</Product>


Result
-------
<tag01>Marco,Polo</tag01>

 

Kind Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

Posted

Perhaps you should whip up a small (but complete enough) 'before' XML file, and then an 'after' XML file, so we can see exactly, and in its entirety, what it is you wish to achieve.

We will also then have something to test with, if needed.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

  Reveal hidden contents

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Posted

Hey there @TheSaint,

It's in my first post. 
But I have now come to the conclusion of this been a bit of a tedious mission to accomplish. I will rather use make an AutoIt program that will manipulate the output file. 

Thanks for the assistance.

Kind Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

Posted
  On 9/5/2018 at 1:31 PM, Skeletor said:

It's in my first post. 

Expand  

Neither of those look like a properly formatted or complete enough XML file to me, and so I find your request somewhat confusing.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

  Reveal hidden contents

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...