Changeset 90bfb42e for common/hostreqs.xsl
- Timestamp:
- 09/21/2013 07:02:11 PM (11 years ago)
- Branches:
- ablfs
- Children:
- d928c71
- Parents:
- 6c83a56
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/hostreqs.xsl
r6c83a56 r90bfb42e 18 18 19 19 <xsl:template match="emphasis"> 20 <!-- We assume that what is emphasized is in the form: 21 aa...aa-dccsaaa (a anything except @, - "dash", d digit, 22 c anything except space, s space) 23 or 24 aa...aasdccsaaa 25 This means we have to replace digits with @, and look for '-@' 26 or ' @' --> 27 <xsl:variable name="normalized-string" 28 select="translate(normalize-space(string()), 29 '0123456789', 30 '@@@@@@@@@@')"/> 31 <xsl:variable name="begin-ver"> 32 <xsl:choose> 33 <xsl:when test="contains($normalized-string,' @')"> 34 <xsl:value-of select="string-length(substring-before($normalized-string,' @'))+1"/> 35 </xsl:when> 36 <xsl:otherwise> 37 <xsl:value-of select="string-length(substring-before($normalized-string,'-@'))+1"/> 38 </xsl:otherwise> 39 </xsl:choose> 40 </xsl:variable> 41 42 <xsl:variable name="remaining-part" 43 select="substring($normalized-string,number($begin-ver)+1)"/> 44 45 <xsl:variable name="end-ver"> 46 <xsl:choose> 47 <xsl:when test="contains($remaining-part,' ')"> 48 <xsl:value-of 49 select="string-length(substring-before($remaining-part,' '))"/> 50 </xsl:when> 51 <xsl:otherwise> 52 <xsl:value-of 53 select="string-length($remaining-part)"/> 54 </xsl:otherwise> 55 </xsl:choose> 56 </xsl:variable> 57 20 58 <xsl:text>local MIN_</xsl:text> 21 59 <xsl:choose> 22 <xsl:when test="contains(string(),' ')"> 23 <xsl:value-of select= 24 "substring-before(substring-after(normalize-space(string()), 25 ' '), 26 '-')"/> 60 <xsl:when test="contains(string(),'Kernel')"> 61 <xsl:text>Linux</xsl:text> 62 </xsl:when> 63 <xsl:when test="contains(string(),'GLIBC')"> 64 <xsl:text>Glibc</xsl:text> 65 </xsl:when> 66 <xsl:when test="contains(string(),'XZ')"> 67 <xsl:text>Xz</xsl:text> 27 68 </xsl:when> 28 69 <xsl:otherwise> 29 <xsl:value-of select="substring-before(string(),'-')"/> 70 <!-- We assume that there are no dash nor space in other names --> 71 <xsl:value-of select="substring(string(),1,number($begin-ver)-1)"/> 30 72 </xsl:otherwise> 31 73 </xsl:choose> 32 74 <xsl:text>_VER=</xsl:text> 33 <xsl:value-of select="substring -after(string(),'-')"/>75 <xsl:value-of select="substring(string(),number($begin-ver)+1,$end-ver)"/> 34 76 <xsl:text> 35 77 </xsl:text>
Note:
See TracChangeset
for help on using the changeset viewer.