小编Fer*_*ndo的帖子

遍历使用xalan:nodeset获得的节点集时,xsl:key不起作用

我发现xsl:key似乎无法正常工作的情况。
我正在将XSLT 1与Xalan(已编译)一起使用,这就是发生的情况:

1.-这有效:名为test1的键可以正常工作:

<xsl:variable name="promosRTF">
  <xsl:copy-of select="promo[@valid='true']"/>
</xsl:variable>
<xsl:variable name="promos" select="xalan:nodeset($promosRTF)" />

<!-- now the key: when defined and used here it works fine: -->
<xsl:key name="test1" match="//promo" use="'anytext'" />
<xsl:for-each select="key('test1','anytext')/*">
  loop through elements in key... ok, works fine
</xsl:for-each>

<xsl:for-each select="$promos/*">
  ..loop through elements in variable $promos ...it is not empty so the loop iterates several times
</xsl:for-each>
Run Code Online (Sandbox Code Playgroud)

2.-这不起作用:现在在循环遍历xalan:nodeset获得的元素的循环内定义并使用了密钥test1(我想这是重点)。

<xsl:variable name="promosRTF">
  <xsl:copy-of select="promo[@valid='true']"/>
</xsl:variable>
<xsl:variable name="promos" select="xalan:nodeset($promosRTF)" />

<xsl:for-each …
Run Code Online (Sandbox Code Playgroud)

xslt xalan xslkey xslt-1.0

5
推荐指数
1
解决办法
1813
查看次数

如何从命令行安装某些节点版本

我想安装节点6.9.4.

在Windows控制台中,我尝试使用:

npm install node@v6.9.4
Run Code Online (Sandbox Code Playgroud)

它会抛出这个错误:

npm ERR! No compatible version found: node@v6.9.4
npm ERR! Valid install targets:
npm ERR! 0.0.0
Run Code Online (Sandbox Code Playgroud)

在linux中,结果是类似的.我试着用

sudo npm install node@v6.9.4
Run Code Online (Sandbox Code Playgroud)

输出是:

npm ERR! version not found: node@6.9.4-cls
Run Code Online (Sandbox Code Playgroud)

有没有办法用npm安装某些节点版本?

node.js npm

5
推荐指数
2
解决办法
1万
查看次数

从 cdn 响应延迟导入

我正在按照本指南使用 React Router 和 Suspense 进行延迟加载:

https://itnext.io/async-react-using-react-router-suspense-a86ade1176dc

这是我到目前为止的代码:

import React, { lazy, Suspense } from 'react';
import { Link, Route, BrowserRouter as Router, Switch } from 'react-router-dom';

const HomePage = (
  lazy(() => (
    import('./pages/HomePage')
  ))
);

const BookingsPage = (
  lazy(() => (
    import('./pages/BookingsPage')
  ))
);

const LoadingMessage = () => (
  <div>I'm loading...</div>
);

class AppProviders extends React.Component {
  constructor (props) {
    super(props);
  }

  render () {
    return <Router>
          <div>
            <ul>
              <li><Link to="/">Home</Link></li>
              <li><Link to="/bookings">Bookings</Link></li>
            </ul>
            <hr /> …
Run Code Online (Sandbox Code Playgroud)

lazy-loading reactjs webpack react-router

3
推荐指数
1
解决办法
2582
查看次数

标签 统计

lazy-loading ×1

node.js ×1

npm ×1

react-router ×1

reactjs ×1

webpack ×1

xalan ×1

xslkey ×1

xslt ×1

xslt-1.0 ×1