XSLT - преобразование XML, передающее значение от одного к другому для определения порядка XML - PullRequest
0 голосов
/ 30 августа 2018

У меня ниже XML

<?xml version="1.0" encoding="utf-8"?>
<!--<!DOCTYPE BMECAT SYSTEM "franke_riess_bme_cat_2005_inbetween.dtd">-->
<BMECAT version="2005" xmlns="http://www.bmecat.org/bmecat/2005fd">
  <T_NEW_CATALOG>
      <CATALOG_GROUP_SYSTEM>
         <CATALOG_STRUCTURE type="root">
            <GROUP_ID>1</GROUP_ID>
            <GROUP_NAME lang="deu">Testdaten</GROUP_NAME>
            <PARENT_ID>0</PARENT_ID>
            <GROUP_ORDER>1</GROUP_ORDER>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="node">
            <GROUP_ID>2462</GROUP_ID>
            <GROUP_NAME lang="deu">Türdrückergarnituren für Zimmertüren</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">Türdrücker für Zimmertüren finden Sie
               hier</GROUP_DESCRIPTION>
            <PARENT_ID>1</PARENT_ID>
            <GROUP_ORDER>0</GROUP_ORDER>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="node">
            <GROUP_ID>2463</GROUP_ID>
            <GROUP_NAME lang="deu">Eurobat</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">EUROBAt Türbeschläge für Zimmertüren, immer
               gut</GROUP_DESCRIPTION>
            <PARENT_ID>2462</PARENT_ID>
            <GROUP_ORDER>0</GROUP_ORDER>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="node">
            <GROUP_ID>2464</GROUP_ID>
            <GROUP_NAME lang="deu">EUROBAT Rosettengarnituren</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">Hier finden sie tolle Rosettengarnitur unserer Hausmarke
               EUROBAT</GROUP_DESCRIPTION>
            <PARENT_ID>2463</PARENT_ID>
            <GROUP_ORDER>0</GROUP_ORDER>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="node">
            <GROUP_ID>2465</GROUP_ID>
            <GROUP_NAME lang="deu">EUROBAT Rosettengarnituren Edelstahl Matt</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">Hier finden sie tolle Rosettengarnitur in Edelstahl Matt
               unserer Hausmarke EUROBAT</GROUP_DESCRIPTION>
            <PARENT_ID>2464</PARENT_ID>
            <GROUP_ORDER>0</GROUP_ORDER>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">20</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="leaf">
            <GROUP_ID>2468</GROUP_ID>
            <GROUP_NAME lang="deu">Eurobat 417 RQ Rosettengarnitur Quadratisch Edelstahl
               Matt</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu"
               >&lt;b&gt;Lieferumfang:&lt;/b&gt;&lt;br&gt;&lt;br&gt;Rosettengarnitur inklusive
               Befestigungsmaterial</GROUP_DESCRIPTION>
            <PARENT_ID>2465</PARENT_ID>
            <GROUP_ORDER>0</GROUP_ORDER>
            <MIME_INFO>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_tuerdrueckergarnitur_417_rq_bb_edelstahl_matt.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>417_RQ_Massskizze.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>2</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_tuerdrueckergarnitur_417_rq_pz_edelstahl_matt.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>3</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_tuerdrueckergarnitur_417_rq_wc_edelstahl_matt.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>4</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>eurobat_tuerdrueckergarnitur_417_rq_bb_edelstahl_matt.psd</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>417_-_RQ_-_Massskizze_p4.ai</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>2</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>\Dokumente\Eurobat\Montagehinweis RR-S.pdf</MIME_SOURCE>
                  <MIME_PURPOSE>data_sheet</MIME_PURPOSE>
                  <MIME_ORDER>0</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_tuerdrueckergarnitur_417_rq_pz_edelstahl_matt.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>icon</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_tuerdrueckergarnitur_417_rq_wg_edelstahl_matt.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>icon</MIME_PURPOSE>
                  <MIME_ORDER>2</MIME_ORDER>
               </MIME>
            </MIME_INFO>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">20</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="node">
            <GROUP_ID>2481</GROUP_ID>
            <GROUP_NAME lang="deu">EUROBAT Rosettengarnituren Edelstahl Poliert</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">Hier finden sie tolle Rosettengarnitur in Edelstahl
               Poliert unserer Hausmarke EUROBAT</GROUP_DESCRIPTION>
            <PARENT_ID>2464</PARENT_ID>
            <GROUP_ORDER>1</GROUP_ORDER>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="leaf">
            <GROUP_ID>2483</GROUP_ID>
            <GROUP_NAME lang="deu">Eurobat BUILDING RQ Rosettengarnitur Quadratisch Edelstahl
               Poliert</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu"
               >&lt;b&gt;Lieferumfang:&lt;/b&gt;&lt;br&gt;&lt;br&gt;Rosettengarnitur inklusive
               Befestigungsmaterial</GROUP_DESCRIPTION>
            <PARENT_ID>2481</PARENT_ID>
            <GROUP_ORDER>1</GROUP_ORDER>
            <MIME_INFO>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_tuerdrueckergarnitur_building_rq_bb_edelstahl_poliert.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>Building_RQ_BB_Massskizze.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>2</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>eurobat_tuerdrueckergarnitur_building_rq_bb_edelstahl_poliert.psd</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>Building_RQ_-_BB_-_Massskizze_p4.ai</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>2</MIME_ORDER>
               </MIME>
            </MIME_INFO>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">20</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="node">
            <GROUP_ID>2511</GROUP_ID>
            <GROUP_NAME lang="deu">EUROBAT Schildgarnituren</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">Hier finden sie tolle Schildgarnituren unserer Hausmarke
               EUROBAT</GROUP_DESCRIPTION>
            <PARENT_ID>2463</PARENT_ID>
            <GROUP_ORDER>1</GROUP_ORDER>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">20</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="leaf">
            <GROUP_ID>2513</GROUP_ID>
            <GROUP_NAME lang="deu">Eurobat 400 LR Langschildgarnitur Rund Edelstahl
               Matt</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu"
               >&lt;b&gt;Lieferumfang:&lt;/b&gt;&lt;br&gt;&lt;br&gt;Langschildgarnitur inklusive
               Befestigungsmaterial</GROUP_DESCRIPTION>
            <PARENT_ID>2511</PARENT_ID>
            <GROUP_ORDER>1</GROUP_ORDER>
            <MIME_INFO>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_tuerdrueckergarnitur_400_lr_bb_edelstahl_matt.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>400_lr_bb_massskizze.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>2</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>eurobat_tuerdrueckergarnitur_400_lr_bb_edelstahl_matt.psd</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>/Dokumente/BEKO/SDB_Schraubendoktor_DE.pdf</MIME_SOURCE>
                  <MIME_PURPOSE>safty_data_sheet</MIME_PURPOSE>
                  <MIME_ORDER>0</MIME_ORDER>
               </MIME>
            </MIME_INFO>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">20</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="node">
            <GROUP_ID>2541</GROUP_ID>
            <GROUP_NAME lang="deu">EUROBAT Türdrückerpaare</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">Hier finden sie tolle Türdrückerpaare unserer Hausmarke
               EUROBAT</GROUP_DESCRIPTION>
            <PARENT_ID>2463</PARENT_ID>
            <GROUP_ORDER>2</GROUP_ORDER>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">30</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="leaf">
            <GROUP_ID>2561</GROUP_ID>
            <GROUP_NAME lang="deu">Eurobat SHELF Türdrückerpaar Edelstahl Poliert</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu"
               >&lt;b&gt;Lieferumfang:&lt;/b&gt;&lt;br&gt;&lt;br&gt;Türdrückerpaar inklusive
               Vierkantstift</GROUP_DESCRIPTION>
            <PARENT_ID>2541</PARENT_ID>
            <GROUP_ORDER>0</GROUP_ORDER>
            <MIME_INFO>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_tuerdrueckerpaar_shelf_edelstahl_poliert.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>eurobat_tuerdrueckerpaar_shelf_edelstahl_poliert.psd</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
            </MIME_INFO>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">30</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="leaf">
            <GROUP_ID>2560</GROUP_ID>
            <GROUP_NAME lang="deu">Eurobat BUILDING Türdrückerpaar Edelstahl Poliert</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu"
               >&lt;b&gt;Lieferumfang:&lt;/b&gt;&lt;br&gt;&lt;br&gt;Türdrückerpaar inklusive
               Vierkantstift</GROUP_DESCRIPTION>
            <PARENT_ID>2541</PARENT_ID>
            <GROUP_ORDER>1</GROUP_ORDER>
            <MIME_INFO>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_tuerdrueckerpaar_building_edelstahl_matt_poliert.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>eurobat_tuerdrueckerpaar_building_edelstahl_poliert.psd</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
            </MIME_INFO>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">30</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="node">
            <GROUP_ID>2584</GROUP_ID>
            <GROUP_NAME lang="deu">EUROBAT Rosetten</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">Hier finden sie tolle Rosetten unserer Hausmarke
               EUROBAT</GROUP_DESCRIPTION>
            <PARENT_ID>2463</PARENT_ID>
            <GROUP_ORDER>3</GROUP_ORDER>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">30</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="leaf">
            <GROUP_ID>2586</GROUP_ID>
            <GROUP_NAME lang="deu">Eurobat Drückerrosetten RR-S 1-farbig Rosetten-Paar
               Schraubrosette</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">• Schraubrosette&lt;br&gt;•
               Metall-Unterkonstruktion&lt;br&gt;• Durchgehende Verschraubung mit M4
               Gewinde&lt;br&gt;&lt;br&gt;&lt;b&gt;Lieferumfang:&lt;/b&gt;&lt;br&gt;&lt;br&gt;1
               Rosettenpaar ohne Befestigungsmaterial</GROUP_DESCRIPTION>
            <PARENT_ID>2584</PARENT_ID>
            <GROUP_ORDER>0</GROUP_ORDER>
            <MIME_INFO>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_tuerdrueckerlochteil_ohne_edelstahl_matt.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_tuerdrueckerlochteil_rrs_edelstahl_poliert.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>2</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_tuerdruecklochteil_rrs_messing_poliert.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>3</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>eurobat_tuerdrueckerlochteil_edelstahl_matt.psd</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>eurobat_tuerdrueckerlochteil_rrs_edelstahl_poliert.psd</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>2</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>eurobat_tuerdrueckerlochteil_rrs_messing_poliert.psd</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>3</MIME_ORDER>
               </MIME>
            </MIME_INFO>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">30</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="leaf">
            <GROUP_ID>2587</GROUP_ID>
            <GROUP_NAME lang="deu">Eurobat BB-Rosetten RR-S 1-farbig Clip-Rundrosette</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">• Metall-Unterkonstruktion&lt;br&gt;• Durchgehende
               Verschraubung mit M4
               Gewinde&lt;br&gt;&lt;br&gt;&lt;b&gt;Lieferumfang:&lt;/b&gt;&lt;br&gt;&lt;br&gt;1
               Rosettenpaar ohne Befestigungsmaterial</GROUP_DESCRIPTION>
            <PARENT_ID>2584</PARENT_ID>
            <GROUP_ORDER>1</GROUP_ORDER>
            <MIME_INFO>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_bb_edelstahl_matt.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_rrs_bb_edelstahl_poliert.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>2</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_rrs_bb_messing_poliert.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>3</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>eurobat_bb_rundrosette_edelstahl_matt.psd</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>eurobat_rrs_bb_edelstahl_poliert.psd</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>2</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>eurobat_rrs_bb_messing_poliert.psd</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>3</MIME_ORDER>
               </MIME>
            </MIME_INFO>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">30</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="node">
            <GROUP_ID>2606</GROUP_ID>
            <GROUP_NAME lang="deu">EUROBAT Knopfteile</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">Hier finden sie tolle Knopfteile unserer Hausmarke
               EUROBAT</GROUP_DESCRIPTION>
            <PARENT_ID>2463</PARENT_ID>
            <GROUP_ORDER>4</GROUP_ORDER>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">30</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="leaf">
            <GROUP_ID>2607</GROUP_ID>
            <GROUP_NAME lang="deu">Eurobat Knopfteil FD flach feststehend</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">• Knopfteil feststehend auf
               Rosette&lt;br&gt;&lt;br&gt;&lt;b&gt;Lieferumfang:&lt;/b&gt;&lt;br&gt;&lt;br&gt;1
               Knopfteil inklusive Wechselstift</GROUP_DESCRIPTION>
            <PARENT_ID>2606</PARENT_ID>
            <GROUP_ORDER>0</GROUP_ORDER>
            <MIME_INFO>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_wg_fd_edelstahl_matt.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>text/plain</MIME_TYPE>
                  <MIME_SOURCE>eurobat_wg_fd_edelstahl_matt.psd</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
            </MIME_INFO>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">30</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
         <CATALOG_STRUCTURE type="leaf">
            <GROUP_ID>2608</GROUP_ID>
            <GROUP_NAME lang="deu">Eurobat Knopfteil flach drehbar</GROUP_NAME>
            <GROUP_DESCRIPTION lang="deu">• Knopfteil
               drehbar&lt;br&gt;&lt;br&gt;&lt;b&gt;Lieferumfang:&lt;/b&gt;&lt;br&gt;&lt;br&gt;1
               Knopfteil inklusive Vierkantstift 8 x 100 mm</GROUP_DESCRIPTION>
            <PARENT_ID>2606</PARENT_ID>
            <GROUP_ORDER>1</GROUP_ORDER>
            <MIME_INFO>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_neu_knopfteil_drehbar_neu.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>normal</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
               <MIME>
                  <MIME_TYPE>image/jpeg</MIME_TYPE>
                  <MIME_SOURCE>eurobat_knopfteil_drehbar_neu.jpg</MIME_SOURCE>
                  <MIME_PURPOSE>detail</MIME_PURPOSE>
                  <MIME_ORDER>1</MIME_ORDER>
               </MIME>
            </MIME_INFO>
            <USER_DEFINED_EXTENSIONS>
               <UDX_CLASSIFICATION_GROUP_ID xmlns="">30</UDX_CLASSIFICATION_GROUP_ID>
            </USER_DEFINED_EXTENSIONS>
         </CATALOG_STRUCTURE>
      </CATALOG_GROUP_SYSTEM>
      <PRODUCT mode="new">
         <SUPPLIER_PID>261310</SUPPLIER_PID>
         <PRODUCT_DETAILS>
            <DESCRIPTION_SHORT lang="deu">EUROBAT KNOPFLOCHTEIL DREHBAR 1-FARBIG EDELSTAHL
               MATT</DESCRIPTION_SHORT>
            <INTERNATIONAL_PID type="ean">4046541032816</INTERNATIONAL_PID>
            <SUPPLIER_ALT_PID>261310</SUPPLIER_ALT_PID>
            <PRODUCT_CATEGORY>standard</PRODUCT_CATEGORY>
         </PRODUCT_DETAILS>
         <PRODUCT_FEATURES>
            <REFERENCE_FEATURE_SYSTEM_NAME>ENVENTA-3.1</REFERENCE_FEATURE_SYSTEM_NAME>
            <FEATURE>
               <FNAME>Material</FNAME>
               <FVALUE>Edelstahl</FVALUE>
            </FEATURE>
            <FEATURE>
               <FNAME>Oberfläche</FNAME>
               <FVALUE>Matt</FVALUE>
            </FEATURE>
            <FEATURE>
               <FNAME>Lochung</FNAME>
               <FVALUE>Knopfteil</FVALUE>
            </FEATURE>
            <FEATURE>
               <FNAME>Vierkant</FNAME>
               <FVALUE>8</FVALUE>
               <FUNIT>MMT</FUNIT>
            </FEATURE>
            <FEATURE>
               <FNAME>Durchmesser</FNAME>
               <FVALUE>53</FVALUE>
            </FEATURE>
         </PRODUCT_FEATURES>
         <PRODUCT_ORDER_DETAILS>
            <ORDER_UNIT>C62</ORDER_UNIT>
            <PRICE_QUANTITY>1.00</PRICE_QUANTITY>
         </PRODUCT_ORDER_DETAILS>
         <PRODUCT_PRICE_DETAILS>
            <PRODUCT_PRICE price_type="net_customer">
               <PRICE_AMOUNT>15.95</PRICE_AMOUNT>
               <PRICE_CURRENCY>EUR</PRICE_CURRENCY>
               <TAX>0.19</TAX>
               <PRICE_FACTOR>1.00</PRICE_FACTOR>
               <LOWER_BOUND>1.00</LOWER_BOUND>
            </PRODUCT_PRICE>
         </PRODUCT_PRICE_DETAILS>
      </PRODUCT>
      <PRODUCT_TO_CATALOGGROUP_MAP>
         <PROD_ID>303196</PROD_ID>
         <CATALOG_GROUP_ID>2607</CATALOG_GROUP_ID>
         <PRODUCT_TO_CATALOGGROUP_MAP_ORDER>346</PRODUCT_TO_CATALOGGROUP_MAP_ORDER>
      </PRODUCT_TO_CATALOGGROUP_MAP>
      <PRODUCT_TO_CATALOGGROUP_MAP>
         <PROD_ID>261310</PROD_ID>
         <CATALOG_GROUP_ID>2608</CATALOG_GROUP_ID>
         <PRODUCT_TO_CATALOGGROUP_MAP_ORDER>347</PRODUCT_TO_CATALOGGROUP_MAP_ORDER>
      </PRODUCT_TO_CATALOGGROUP_MAP>
   </T_NEW_CATALOG>
</BMECAT>

Мне нужно изменить порядок XML с помощью XSLT. Порядок должен быть таким, как показано ниже. Например:

Преобразованный XML должен быть отсортирован по элементу <CATALOG_GROUP_SYSTEM> и должен начинаться с корня.

<CATALOG_STRUCTURE type="root">
    <GROUP_ID>1</GROUP_ID>
    <GROUP_NAME lang="deu">EUROFER-PORTAL</GROUP_NAME>
    <PARENT_ID>0</PARENT_ID>
    <GROUP_ORDER>1</GROUP_ORDER>
</CATALOG_STRUCTURE>

Это начальный элемент, так как он имеет самый низкий <PARENT_ID> с "0" и самый низкий <GROUP_ORDER> на этом <PARENT_ID> уровне. следующий <CATALOG_STRUCTURE> элемент должен быть:

    <CATALOG_STRUCTURE type="node">
        <GROUP_ID>103770</GROUP_ID>
        <GROUP_NAME lang="deu">Fenstertechnik</GROUP_NAME>
        <PARENT_ID>1</PARENT_ID>
        <GROUP_ORDER>0</GROUP_ORDER>
    </CATALOG_STRUCTURE>

Это первый элемент после корня, потому что он имеет самый низкий <GROUP_ORDER>, а его <PARENT_ID> является <GROUP_ID> корня. После этого элемента будет:

    <CATALOG_STRUCTURE type="node">
        <GROUP_ID>114524</GROUP_ID>
        <GROUP_NAME lang="deu">Rollladenmotoren und Hausautomation</GROUP_NAME>
        <PARENT_ID>103770</PARENT_ID>
        <GROUP_ORDER>116</GROUP_ORDER>
    </CATALOG_STRUCTURE>

, потому что <PARENT_ID> - это <GROUP_ID> в «Fenstertechnik», и это элемент с самым низким <GROUP_ORDER> из всех элементов с этим <PARENT_ID>. После этого элемента будет:

    <CATALOG_STRUCTURE type="node">
        <GROUP_ID>114525</GROUP_ID>
        <GROUP_NAME lang="deu">EUROBAT Rollladenmotoren</GROUP_NAME>
        <PARENT_ID>114524</PARENT_ID>
        <GROUP_ORDER>0</GROUP_ORDER>
    </CATALOG_STRUCTURE>

, потому что <PARENT_ID> - это <GROUP_ID> в «Rollladenmotoren und Hausautomation» и это элемент с самым низким <GROUP_ORDER> из всех элементов с этим <PARENT_ID>. После этого элемента будет:

   <CATALOG_STRUCTURE type="leaf">
        <GROUP_ID>114532</GROUP_ID>
        <GROUP_NAME lang="deu">EUROBAT Rollladenmotor Mechanisch inklusive Zubehör</GROUP_NAME>
        <GROUP_DESCRIPTION lang="deu">…</GROUP_DESCRIPTION>
        <PARENT_ID>114525</PARENT_ID>
        <GROUP_ORDER>216</GROUP_ORDER>
    </CATALOG_STRUCTURE>

, потому что <PARENT_ID> - это <GROUP_ID> для EUROBAT Rollladenmotoren, и это элемент с самым низким <GROUP_ORDER> из всех элементов с этим <PARENT_ID>.

После этого элемента будут все продукты с <PARENT_ID> = 114524 в порядке <GROUP_ORDER>. После этих продуктов будет следующая категория. Это будет продолжаться.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...