a.binder 9 лет назад
Родитель
Сommit
afdc51cb6b

+ 4 - 4
SE/dev/php-cli/biale_plamy_class_usage.php

@@ -7,11 +7,11 @@ $test->enableShowProgress();
 $test->loadCache();
 
 
-//$test->generateWays();
-//$test->generateXpoints();
+$test->generateWays();
+$test->generateXpoints();
 ////$test->generateJoins();
-//$test->generatePrzylacza();
-//$test->saveCache();
+$test->generatePrzylacza();
+$test->saveCache();
 
 $test->saveXML();
 

+ 39 - 0
SE/dev/php-cli/ways_as_Text_z_ID_xml.xsl

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:bp="https://procesy5.pl/biale_plamy-schema.xsd"
+    exclude-result-prefixes="xs"
+    version="2.0">
+    
+    <xsl:import href="asText.xsl"/>
+    <xsl:param name="ways2drogi.xml" select="'ways2drogi.xml'"/>
+    <xsl:variable name="ways2drogi" select="doc($ways2drogi.xml)"/>
+    
+    <xsl:output indent="yes"/>
+    <xsl:strip-space elements="*"/>
+    
+    
+    <xsl:template match="ways_asText">
+        <ways_asText_z_ID_xml>
+            <xsl:apply-templates/>
+        </ways_asText_z_ID_xml>
+    </xsl:template>
+    
+    <xsl:template match="item">
+        <item>
+        <xsl:copy-of select="@*"/>
+            <xsl:attribute name="ID_Way" select="$ways2drogi/ways2drogi/item[@id= current()/@id]/text()"/>
+        <xsl:apply-templates/>
+        </item>
+    </xsl:template>
+    
+    
+    <xsl:template match="text()">
+        <xsl:variable name="asText">
+            <asText>
+                <xsl:copy-of select="."/>
+            </asText>
+        </xsl:variable>
+        <xsl:apply-templates select="$asText"/>
+    </xsl:template>
+</xsl:stylesheet>