Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
5
Erster Beitrag:
vor 1 Jahr, 3 Monaten
Letzter Beitrag:
vor 1 Jahr, 3 Monaten
Beteiligte Autoren:
DarrenF, Arie, Fabrice Harari

[WD21] TableToXML question...

Startbeitrag von DarrenF am 08.08.2016 10:42

Hi guys,

Question regarding TableToXML function; I have a Table Control with data in it and use TableToXML to produce an XML file, and all works well, but how do I change the default "WINDEV_TABLE" & "\WINDEV_TABLE" tags to be what I want them to be (as below - XML gt & lt chars replaced with curly brackets to make it readable)?

I can see where the "ProductsToWebsite" and the individual items come from; they are the name of the Table Control and the column names - all good, but where does "WINDEV_TABLE" come from?

Anyone know how to change this default value or if it's even possible to change it?


{?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?}
{WINDEV_TABLE}
{ProductsToWebsite}
{SKU}9000000001234{/SKU}
{Description}Shimano XYZ Jersey{/Description}
{LongDescription}Shimano XYZ Jersey (long description){/LongDescription}
{Options}Red: L:{/Options}
{StockQty}3{/StockQty}
{Price}14.99{/Price}
{TimeStamp}20160808003306544{/TimeStamp}
{Mode}A{/Mode}
{/ProductsToWebsite}
...
...
...
{\WINDEV_TABLE}

Antworten:

Hi Darren

I don't know if it's possible during the process, but afterword, with
MyString is string=floadtext(XML file)
Mystring=replace(Mystring,"WINDEV_TABLE","Whatever you want")
fsavetext(...)

it's clearly very easy

Best regards

von Fabrice Harari - am 08.08.2016 12:06
Darren,

inTableToExcel the TITLE of the tablecontrol is used. Maybe you have a tablecontrol without a 'table title'?

von Arie - am 08.08.2016 12:10
Hi,

@Fabrice, yes I could use Replace, I just wanted to confirm I wasn't missing something, but I also want to avoid having to change every file before it goes out.

@Arie, Yes, "ProductsToWebsite" is the table control title... can't see anything in the table control that mentions "WINDEV_TABLE". WD adds "WINDEV_TABLE" to encapsulate all the records in the table control. Looks like it's a hard coded default?

As always, thanks for responding... :spos:

von DarrenF - am 08.08.2016 13:10
...and using HExportXML, "HF_DOCUMENT" is output to the XML in place of "WINDEV_TABLE"...

von DarrenF - am 09.08.2016 07:57
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.