Comments (8)
@DUnger Are you sure it is related to this library? I just pushed a test that proves that this library is behaving the same as libxslt. Or is my test wrong?
from xsl.
i don't know much about xsl. The xsl and xml file were created by other persons.
With your test file i get the result and following xml:
<ItemTypes>
<Item id="test">
<Requirement id="subtest" min="10"/>
<Requirement id="subtest2" min="20"/>
<Requirement id="subtest3" min="30"/>
<Requirement id="subtest4" min="40"/>
</Item>
</ItemTypes>
Result
0 => 10, 0 => 20, 0 => 30, 0 => 40
expected result:
subtest => 10, subtest2 => 20, subtest3 => 30, subtest4 => 40
i don't know if i'm doing something wrong
from xsl.
@DUnger That is not the expected result.
count(id(@id)/preceding-sibling::*)
This returns a count. So if we would expect something, it would be an integer, not a string. If I change the stylesheet to this.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select=".//Requirement" mode="min"/>
</xsl:template>
<xsl:template match="Requirement|EffectReq" mode="min">
<xsl:value-of select="@id"/> => <xsl:value-of select="@min"/><xsl:if test="position()!=last()">, </xsl:if>
</xsl:template>
</xsl:stylesheet>
Then I am expecting a string because @id
returns a string.
from xsl.
By the way, if you are using this library: you can use XSL 2.0 (that is the purpose of this library). Then you can do this.
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select=".//Requirement" mode="min"/>
</xsl:template>
<xsl:template match="Requirement|EffectReq" mode="min">
<xsl:value-of select="concat(@id, ' => ', @min)" separator=","/>
</xsl:template>
</xsl:stylesheet>
from xsl.
Sry. i think it was my bad. I made some mistakes.
XSL: https://github.com/Uga-Agga/Game/blob/master/src/config/config.php.xsl
DTD: https://github.com/Uga-Agga/Game/blob/master/src/config/config.php.xsl
XML header:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Config SYSTEM "config.dtd">
<Config>
....
is the config.dtd parsed/included?
from xsl.
@DUnger My library is not doing anything with it. So it depends if the native PHP extension is parsing/including it.
from xsl.
Ok, thank you for your help. It was my bad.
from xsl.
No problem, hope the package is useful.
from xsl.
Related Issues (15)
- Support all Xpath 2.0 functions
- Support Xsl 2.0 elements
- Any thoughts in supporting XSLT 3.0 in the future? HOT 2
- Lexer bug
- Curly braces implementation too easy HOT 1
- Confirm support for Windows HOT 2
- Crash when empty xs:date
- Support for powerful xpath expressions
- Support for loops HOT 1
- Catchable fatal error HOT 6
- Tests don't pass using PHP 7.4 HOT 6
- xsl:sequence HOT 2
- getting null issue HOT 10
- XSLT/SCH files HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xsl.