Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7784761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:08:48+00:00 2026-06-01T20:08:48+00:00

I need to get an attribute from svg file on classic asp. But my

  • 0

I need to get an attribute from svg file on classic asp. But my code don’t work. Any idea?

id attribute from font tag.

<font id="LetterGothicStdRegular" horiz-adv-x="1228" >

asp function

function getFontId(url)
Set objXml = Server.CreateObject("MSXML2.DomDocument.6.0")
'objXml.async = False
objXml.LoadXML(url)

For Each oNode In objXml.SelectNodes("svg/defs/font")
  sKey = oNode.GetAttribute("id")
 ' sValue = oNode.Text
  getXML=sKey
Next

Set objXml= Nothing
end function

svg code:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
    <metadata>This is a custom SVG webfont generated by Font Squirrel.        Copyright   :  1987 1990 1991 1995 1998 2001 2002 Adobe Systems Incorporated All rights reserved        Foundry     : Adobe </metadata>
    <defs>
        <font id="LetterGothicStdRegular" horiz-adv-x="1228">
            <font-face units-per-em="2048" ascent="1520" descent="-528"/>
            <missing-glyph horiz-adv-x="500"/>
            <glyph unicode="2" horiz-adv-x="1783" d="M149 1099l66 51l672 -696l671 696l66 -51l-737 -776z"/>
            <glyph unicode="8" horiz-adv-x="1783" d="M167 430l737 776l738 -776l-66 -51l-672 696l-671 -696z"/>
            <glyph unicode="&#x3c;" d="M201 737l776 738l51 -66l-696 -672l696 -671l-51 -66z"/>
            <glyph unicode="&#x3e;" d="M288 66l696 671l-696 672l51 66l776 -738l-776 -737z"/>
            <glyph unicode="&#x2000;" horiz-adv-x="737"/>
            <glyph unicode="&#x2001;" horiz-adv-x="1475"/>
            <glyph unicode="&#x2002;" horiz-adv-x="737"/>
            <glyph unicode="&#x2003;" horiz-adv-x="1475"/>
            <glyph unicode="&#x2004;" horiz-adv-x="491"/>
            <glyph unicode="&#x2005;" horiz-adv-x="368"/>
            <glyph unicode="&#x2006;" horiz-adv-x="245"/>
            <glyph unicode="&#x2007;" horiz-adv-x="245"/>
            <glyph unicode="&#x2008;" horiz-adv-x="184"/>
            <glyph unicode="&#x2009;" horiz-adv-x="295"/>
            <glyph unicode="&#x200a;" horiz-adv-x="81"/>
            <glyph unicode="&#x202f;" horiz-adv-x="295"/>
            <glyph unicode="&#x205f;" horiz-adv-x="368"/>
            <glyph unicode="&#xe000;" horiz-adv-x="500" d="M0 0v0v0v0v0z"/>
        </font>
    </defs>
</svg>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:08:49+00:00Added an answer on June 1, 2026 at 8:08 pm

    You can parse specifying svg selection namespace.
    Plus, the parameter name is url, this make sense if it’s a url? Because loadXML loads only from a string containing xml. You should use Load with setting ServerHTTPRequest property to True if url is remote.
    Check out validateOnParse and resolveExternals. Here’s an example:

    Function getFontId(url)
        With Server.CreateObject("MSXML2.DomDocument.6.0")
            .async = False
            .validateOnParse = False 'parse only for well-formed xml, no more
            .resolveExternals = False
            .setProperty "ServerHTTPRequest", True
            .setProperty "ProhibitDTD", False ' it's true by default in 6.0
            If .Load(url) Then
                .setProperty "SelectionNamespaces", "xmlns:svg='http://www.w3.org/2000/svg'"
                Dim domAttrId
                Set domAttrId = .selectSingleNode("//svg:defs/svg:font/@id")
                If domAttrId Is Nothing Then 
                    'node nor attribute not exists
                Else
                    getFontId = domAttrId.Value
                End If
            Else
                With .parseError
                    Err.Raise .errorCode, .srcText, .reason
                End With
            End If
        End With
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get the class attribute from the body element of a page
I need the get the href attribute from the following: <tr> <td><h2 class=officers><a href=/finance/stocks/officerProfile?symbol=ABB.N&officerId=232795
I need to be able get a single specific attribute from an element with
I'm using this code to get the alt attribute from img tags using domdocument.
I need to get a YAML file from the web and parse it using
I cannot seem to get the backup attribute parameter working from my code. No
I need to get the class attribute of checked radio button, with name=radio. Used
After load content to page using div.load('page.php'); I need get all of links from
I'm new in iPhone Application Programming. I can't get value from XML file and
I need all new MenuItem models to have menu attribute from parent collection. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.