how to give dynamic host url in config ...
Hi folks
<config charset="UTF-8"></config>
<var-def name="startUrl">http://news.bbc.co.uk</var- def></var-def>
<var-def name="urlList"></var-def>
<xpath expression="//img/@src"></xpath>
<html-to-xml></html-to-xml>
<http url="startUrl/"></http>
<loop filter="unique" item="link" maxloops="10" index="i"></loop>
<list></list>
<file action="write" path="images/${i}.gif" type="binary"></file>
<http url="${sys.fullUrl(startUrl, link)}"></http>
in the above config file we have one start url . but i want to give 10 start url is it possible
Do something like:
<var-def name="startUrl"></var-def>
<loop item="url"></loop>
<xpath expression="data(//url)"></xpath>
<empty></empty>
<http url="${url}"></http>
<http url="${link}"></http>
Hi nakoned
Thanks for ur post it was usefull to me.
can u tell me how to split a string using delimiter
for example:
inside <xq-expression><![CDATA)</xq-expression>
return
<school></school>
]]>
here i get fulladdress "india , chennai , 123rd street"
i want to split this.
i tried with xquery function its returning me an error
Thanks
you probably want to take a look at 'tokenize' xpath function.
Re 1st question - there is absolutely no need of CDATA or Xpath in this case :)
The following straightforward way works:
<def var="urls"> url1 url2 url3 </def> <loop ....> <list> <get var="urls"/> </list> </loop>
Re 2nd question - yes, XPath tokenize would do.
Log in to post a comment.
how to give dynamic host url in config ...
Hi folks
<config charset="UTF-8"></config>
<var-def name="startUrl">http://news.bbc.co.uk</var-
def></var-def>
<var-def name="urlList"></var-def>
<xpath expression="//img/@src"></xpath>
<html-to-xml></html-to-xml>
<http url="startUrl/"></http>
<loop filter="unique" item="link" maxloops="10" index="i"></loop>
<list></list>
<file action="write" path="images/${i}.gif" type="binary"></file>
<http url="${sys.fullUrl(startUrl, link)}"></http>
in the above config file we have one start url . but i want to give 10 start
url is it possible
Do something like:
<config charset="UTF-8"></config>
<var-def name="startUrl"></var-def>
<loop item="url"></loop>
<list></list>
<xpath expression="data(//url)"></xpath>
<empty></empty>
<var-def name="urlList"></var-def>
<xpath expression="//img/@src"></xpath>
<html-to-xml></html-to-xml>
<http url="${url}"></http>
<loop filter="unique" item="link" maxloops="10" index="i"></loop>
<list></list>
<file action="write" path="images/${i}.gif" type="binary"></file>
<http url="${link}"></http>
Hi nakoned
Thanks for ur post it was usefull to me.
can u tell me how to split a string using delimiter
for example:
inside <xq-expression><![CDATA)</xq-expression>
return
<school></school>
{data($fulladdress)}]]>
here i get fulladdress "india , chennai , 123rd street"
i want to split this.
i tried with xquery function its returning me an error
Thanks
you probably want to take a look at 'tokenize' xpath function.
Re 1st question - there is absolutely no need of CDATA or Xpath in this case
:)
The following straightforward way works:
Re 2nd question - yes, XPath tokenize would do.