Finding Links Beginning with "/http://" in an index block

dshaykew's Avatar

dshaykew

04 Nov, 2011 06:42 PM

Hi All.

Occasionally external links in our pages/blocks will be re-written with a leading slash. I don't know whether this happens in the WYSIWYG or on the way into the database.

Anyway, I'm trying to write a report to find these links so I can fix them. The report is a variation of a report we use to find links in a soon to be released site to that site's old URLs. But, when I do the XSLT search for the string "/http://", I don't find any results - I'm assuming that this is because internal links (i.e., ones that begin with "/") are actually transformed to some sort of unique id of the linked-to internal asset.

Can you think of a way I can find the links starting with "/http://" with XSLT against an index block?

Thanks.

DS

  1. 2 Posted by dshaykew on 04 Nov, 2011 06:59 PM

    dshaykew's Avatar

    Think I figured it out. I had to preface the "/http://" with the site name:

    "site://Graduate Studies/http://"

  2. 3 Posted by Brent Arrington on 04 Nov, 2011 07:09 PM

    Brent Arrington's Avatar

    Hi Dave,

    You should be able to query for just the /http:// substring using contains() without having to hard-code the full site name prefix, if you want to make it more generic.

    So, for example, something like:

    a[contains(@href, '/http://')]
    

    This way, the same query should work regardless of site.

  3. 4 Posted by Brent Arrington on 04 Nov, 2011 07:11 PM

    Brent Arrington's Avatar

    The above is part of an XPath string, in case that wasn't clear.

  4. 5 Posted by dshaykew on 05 Nov, 2011 12:32 AM

    dshaykew's Avatar

    Thanks Brent. Yeah, based on my previous report I was doing a "starts-with". "contains" will work much better.

    Any idea why the links are being re-written.

  5. Support Staff 6 Posted by Ryan Griffith on 21 Jun, 2012 05:38 PM

    Ryan Griffith's Avatar

    Hi dshaykew,

    I was going over some older discussions and notice this one is still open. Were you able to figure out why the links were being rewritten? If not, could you post some steps to replicate so we can look into this further?

    Please feel free to let us know if you have any other questions.

    Thanks.

  6. 7 Posted by dshaykew on 25 Jun, 2012 05:04 PM

    dshaykew's Avatar

    Haven't noticed it lately (though I haven't been doing much building lately). I'll post if I notice it again. For now, you can close the discussion.

  7. Support Staff 8 Posted by Ryan Griffith on 25 Jun, 2012 05:43 PM

    Ryan Griffith's Avatar

    Thank you, dshaykew. Feel free to reply or comment on this discussion to re-open it.

  8. Ryan Griffith closed this discussion on 25 Jun, 2012 05:43 PM.

Comments are currently closed for this discussion. You can start a new one.