using for XML PATH to make html by SQL

  • Hello

    I want to make HTML below by for xml path in sql.

    <div class="navi clr">

    <span class="prev disabled">

    <i></i>

    </span>

    <span class="active">1</span>

    <a href="/2">2</a>

    <a href="/3">3</a>

    <a href="/4">4</a>

    <a href="/5">5</a>

    <a href="/6">6</a>

    <span>...</span>

    <a href="/270">270</a>

    <a class="next" href="/2">

    <i></i>

    </a>

    </div>

    I use below Xml but I have an error "Incorrect syntax near the keyword 'for'."

    (select ''navi clr'' as "@class" ,

    ''prev disabled'' as [span/@class] ,

    ''active'' as [span/@class],

    (SELECT [Ticketing].[dbo].[dmn_LinkMaker] (#userxml# , ''pageno'' , page)) as

    FROM [Ticketing].[dbo].[dmn_paging] (#perpage#,#pageno#,#allcount#,#countP#) where sta = ''no''

    FOR XML path(''div''), type) ,

    (select ''navi clr'' as "@class" ,

    ''/2'' as [a/@href] ,

    ''next'' as [a/@class]

    from [Ticketing].[dbo].[dmn_paging] (#perpage#,#pageno#,#allcount#,#countP#)where sta = ''nex''

    FOR XML path(''div''), type)

    for xml path ('''') , type))

    Please Help me How can I make this HTML by Xml path?

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply