我有一个XML格式如下:
<ComRequest>
<root lineId="1" creator="jumnix">
<component lineId="101">
<compLine lineId="1001">1</compLine>
<compLine lineId="1002">2</compLine>
<compLine lineId="1003">3</compLine>
<compLine lineId="1004">4</compLine>
<compLine lineId="1005">5</compLine>
<compLine lineId="1006">6</compLine>
<compLine lineId="1007">7</compLine>
<compLine lineId="1008">8</compLine>
<compLine lineId="1009">9</compLine>
<compLine lineId="1010">10</compLine>
<compLine lineId="1011">11</compLine>
</component>
<component lineId="102">
<compLine lineId="1012">12</compLine>
<compLine lineId="1013">13</compLine>
<compLine lineId="1014">14</compLine>
<compLine lineId="1015">15</compLine>
<compLine lineId="1016">16</compLine>
<compLine lineId="1017">17</compLine>
<compLine lineId="1018">18</compLine>
<compLine lineId="1019">19</compLine>
<compLine lineId="1020">20</compLine>
<compLine lineId="1021">21</compLine>
<compLine lineId="1022">22</compLine>
</component>
</root>
</ComRequest>
Run Code Online (Sandbox Code Playgroud)
我需要获得具有10个'compLine'元素的'组件'节点的计数.直到现在我有以下XPath查询 -
count(//*[local-name()='ComRequest']/*[local-name()='root']/*[local-name()='component']/*[local-name()='compLine' and count(self) gt 10])
Run Code Online (Sandbox Code Playgroud)
但这不起作用(给出'0'结果).任何有助于解决此问题的帮助表示赞赏.
虽然这是可能的并且不会引发错误,但我想知道在一行中 var 作用域多个变量是否是一种经过批准的做法,如下所示:
<cfset VAR var1 = var2 = var3 = ''>
Run Code Online (Sandbox Code Playgroud)
我将不胜感激所有的想法和意见,特别是如果它们带有文档作为支持论据。我知道它可以正常工作而不会引发错误,但我找不到具体的文档来说明它是否会作用于变量或仅声明该值。
谢谢!
我试图将JQuery lib包含在joomla中,但它不起作用.许多comps和模块在我的CMS中使用mootools.我认为问题是两个框架之间的冲突.
我搜索了互联网,发现了一些文章,但以下代码仍未按预期工作.
<?php
JHTML::stylesheet('demo_page.css', 'media/system/css/');
JHTML::stylesheet('ftab.css', 'media/system/css/');
JHTML::stylesheet('demo_table.css', 'media/system/css/');
$option="com_mycomp";
$base=JUri::root().'components/'.$option.'/js/';
$document=&JFactory::getDocument();
$noConflict="jQuery.noConflict();";
//$document->addScriptDeclaration($noConflict);
$document->addScriptDeclaration("jQuery(document).ready(function($){jQuery('#example').dataTable();});");
JHTML::script('jquery.js',$base,true);
$document->addScript($base,'jquery.js');
$document->addScript($base,'jquery.dataTables.js');
?>
Run Code Online (Sandbox Code Playgroud)
这应该使用JQuery对我的表进行排序,但事实并非如此.
如何在joomla中同时使用mootools和jQuery?
预先感谢您的帮助!
我有一个应用程序,将检查我们的CDN上是否存在javascript文件,我想在浏览器窗口中显示该文件的内容.我找到了所有的螺母和螺栓,当我放入它存在的URL时,我只需要显示javascript文件的内容.
提前致谢.
我有以下查询返回错误:"关键字'VIEW'附近的语法不正确." 我试图在网上和SO中找到这个实例的任何参考.如果我忽略了一个解决方案,或者如果有人有任何建议我会非常感激.
查询:
<cfquery datasource="#mydatasource#">
CREATE VIEW #arguments.bulkRow.request_by#_uploader_features_view
(
feature_products_id
, feature_text
, feature_priority
)
AS
SELECT
a1.tbl_products__products_id AS feature_products_id,
a1.tbl_productfeature__feature_text__1 AS feature_text,
1 AS feature_priority
FROM bulk_product_upload a1
WHERE processed = 0
AND request_by = <cfqueryparam value="#arguments.bulkRow.request_by#" cfsqltype="cf_sql_varchar">
AND LEN( a1.tbl_productfeature__feature_text__1 ) > 1
UNION
SELECT
a1.tbl_products__products_id AS feature_products_id,
a1.tbl_productfeature__feature_text__2 AS feature_text,
2 AS feature_priority
FROM bulk_product_upload a1
WHERE processed = 0
AND request_by = <cfqueryparam value="#arguments.bulkRow.request_by#" cfsqltype="cf_sql_varchar">
AND LEN(a1.tbl_productfeature__feature_text__2) > 1
...
UNION
SELECT
a1.tbl_products__products_id AS feature_products_id,
a1.tbl_productfeature__feature_text__20 …
Run Code Online (Sandbox Code Playgroud) coldfusion ×3
coldfusion-9 ×2
javascript ×2
mootools ×2
frameworks ×1
jquery ×1
mysql ×1
sql ×1
xml ×1
xpath ×1