XML String Bearbeiten Über Hilfe wäre ich sehr dankbar habe keine Ahnung wie ich das lösen kann

  • VB.NET

Es gibt 2 Antworten in diesem Thema. Der letzte Beitrag () ist von dcmagie.

    XML String Bearbeiten Über Hilfe wäre ich sehr dankbar habe keine Ahnung wie ich das lösen kann

    Spoiler anzeigen

    XML-Quellcode

    1. <?xml version="1.0" encoding="UTF-8"?>
    2. -<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
    3. -<product>
    4. <id/>
    5. <id_manufacturer/>
    6. <id_supplier/>
    7. <id_category_default/>
    8. <new/>
    9. <cache_default_attribute/>
    10. <id_default_image/>
    11. <id_default_combination/>
    12. <id_tax_rules_group/>
    13. <position_in_category/>
    14. <type/>
    15. <id_shop_default/>
    16. <reference/>
    17. <supplier_reference/>
    18. <location/>
    19. <width/>
    20. <height/>
    21. <depth/>
    22. <weight/>
    23. <quantity_discount/>
    24. <ean13/>
    25. <isbn/>
    26. <upc/>
    27. <cache_is_pack/>
    28. <cache_has_attachments/>
    29. <is_virtual/>
    30. <state/>
    31. <additional_delivery_times/>
    32. -<delivery_in_stock>
    33. <language id="1"/>
    34. </delivery_in_stock>
    35. -<delivery_out_stock>
    36. <language id="1"/>
    37. </delivery_out_stock>
    38. <on_sale/>
    39. <online_only/>
    40. <ecotax/>
    41. <minimal_quantity/>
    42. <low_stock_threshold/>
    43. <low_stock_alert/>
    44. <price/>
    45. <wholesale_price/>
    46. <unity/>
    47. <unit_price_ratio/>
    48. <additional_shipping_cost/>
    49. <customizable/>
    50. <text_fields/>
    51. <uploadable_files/>
    52. <active/>
    53. <redirect_type/>
    54. <id_type_redirected/>
    55. <available_for_order/>
    56. <available_date/>
    57. <show_condition/>
    58. <condition/>
    59. <show_price/>
    60. <indexed/>
    61. <visibility/>
    62. <advanced_stock_management/>
    63. <date_add/>
    64. <date_upd/>
    65. <pack_stock_type/>
    66. -<meta_description>
    67. <language id="1"/>
    68. </meta_description>
    69. -<meta_keywords>
    70. <language id="1"/>
    71. </meta_keywords>
    72. -<meta_title>
    73. <language id="1"/>
    74. </meta_title>
    75. -<link_rewrite>
    76. <language id="1"/>
    77. </link_rewrite>
    78. -<name>
    79. <language id="1"/>
    80. </name>
    81. -<description>
    82. <language id="1"/>
    83. </description>
    84. -<description_short>
    85. <language id="1"/>
    86. </description_short>
    87. -<available_now>
    88. <language id="1"/>
    89. </available_now>
    90. -<available_later>
    91. <language id="1"/>
    92. </available_later>
    93. -<associations>
    94. -<categories>
    95. -<category>
    96. <id/>
    97. </category>
    98. </categories>
    99. -<images>
    100. -<image>
    101. <id/>
    102. </image>
    103. </images>
    104. -<combinations>
    105. -<combination>
    106. <id/>
    107. </combination>
    108. </combinations>
    109. -<product_option_values>
    110. -<product_option_value>
    111. <id/>
    112. </product_option_value>
    113. </product_option_values>
    114. -<product_features>
    115. -<product_feature>
    116. <id/>
    117. <id_feature_value/>
    118. </product_feature>
    119. </product_features>
    120. -<tags>
    121. -<tag>
    122. <id/>
    123. </tag>
    124. </tags>
    125. -<stock_availables>
    126. -<stock_available>
    127. <id/>
    128. <id_product_attribute/>
    129. </stock_available>
    130. </stock_availables>
    131. -<accessories>
    132. -<product>
    133. <id/>
    134. </product>
    135. </accessories>
    136. -<product_bundle>
    137. -<product>
    138. <id/>
    139. <quantity/>
    140. </product>
    141. </product_bundle>
    142. </associations>
    143. </product>
    144. </prestashop>


    Hallo

    bekomme obigen XML-String als Vorlage vom Webservice geliefert und möchte damit ich Artikel anlegen kann die entsprechenden Nodes bearbeiten. Die sage ich mal einfachen bekomme ich hin aber wie zum Beispiel für die id_tax-Rules bekomme ich das nicht
    hin. Kann mir da einer vielleicht helfen was ich da machen muss damit ich den entsprechen Node im String wie unten anpassen kann?

    XML-Quellcode

    1. -<id_tax_rules_group xlink:href="http://999.0.0.1/prestashop/api/tax_rule_groups/1">
    2. -<![CDATA[1]]>
    3. </id_tax_rules_group>


    Vielen Dank

    Code-Tags eingefügt. Spoiler-Tag eingefügt. ~Thunderbolt

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Thunderbolt“ ()

    @dcmagie Willkommen im Forum. :thumbup:
    Zunächst ist Dein XML-Code nicht "wohlgeformt":

    Da bekommst Du Schwierigkeiten mit Standard-XML-Readern.
    Wenn dann das Format stimmt, übergebe das Dokument einer XDocument-Instanz, da kannst Du Dich dann durchhangeln:
    docs.microsoft.com/de-de/dotne…/xdocument-class-overview
    [Anfänger] XML-Verarbeitung mit XDocument
    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    Programmierfragen über PN / Konversation werden ignoriert!
    *Vollzitat entfernt*
    Kann durch kopieren gekommen sein bekomme die Vorlage vom Webservice. Ich benutze schon Das XDocument und gehe den XML-String durch und finde den Eintrag auch weiss aber jetzt nicht wie ich das entsprechend anpassen soll/muss.

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Marcus Gräfe“ ()