How to Escape HTML URL via XML - html

So we just got a new phone system in the office. I am trying to figure out if there is a possibility to store contact photos of the various people in the company contact list outside of the individual phone storage. Currently we have to upload a photo for each person for each phone (since it is stored internally). We are able to import/upload a XML file to the phone. Below is where I am currently:
<?xml version="1.0" encoding="utf-8"?>
<contactData version="1.0">
<phonebook>
<contact sDisplayName="Test" sOfficeNumber="1111" sMobilNumber="2023929323" sOtherNumber="" Account_Id="8" Ring_Id="0" sGroupName="" photoCustom='..\i.imgur.com\ul8Hmru.jpg' photoSelect="0"/>
</phonebook>
<blacklist/>
<groupinfo/>
</contactData>
The images uploaded show as http://192.168.x.x/head_icon/imagename.jpg, when uploading the above xml, I got out of the head_icon folder and get it to show http://192.168.x.x/i.imgur.com/ul8Hmru.jpg. Is there a way to further escape the local IP so it goes and makes an attempt to fetch the image (allowing us to do a mass import of contacts storing the photos online somewhere)?

The value of the attribute photoCustom is using a relative URL, you need to specify an absolute URL (full path, starting http://)
<?xml version="1.0" encoding="utf-8"?>
<contactData version="1.0">
<phonebook>
<contact sDisplayName="Test"
sOfficeNumber="1111"
sMobilNumber="2023929323"
sOtherNumber=""
Account_Id="8"
Ring_Id="0"
sGroupName=""
photoCustom='http://192.168.x.x/i.imgur.com/ul8Hmru.jpg'
photoSelect="0"/>
</phonebook>
<blacklist/>
<groupinfo/>
</contactData>

Related

Ground Overlay in Google map?

I'd like upload the KML file which including the PNG file on the Google Map.
The process was done normally. But I could not see the PNG data on the Google map.
Related files are as follows;
1) KML source file with text format;
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<GroundOverlay><name>ER001_Polda Balicpapan.png</name><color>88ffffff</color><Icon>
<href>ER001_Polda Balicpapan.png</href>
<viewBoundScale>0.75</viewBoundScale></Icon><LatLonBox>
<north>-.690568</north>
<south>-1.770432</south>
<east> 117.8462</east>
<west> 115.925</west>
</LatLonBox></GroundOverlay></kml>`
2) Message on the Google map
It can not display a row of data(ER001.PNG)
Please let me know that how can I display this Ground Overlay on the Google Map?
See the example in the documentation
Put the image somewhere publicly available and use the fully qualified URL.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Folder>
<name>Ground Overlays</name>
<description>Examples of ground overlays</description>
<GroundOverlay>
<name>Large-scale overlay on terrain</name>
<description>Overlay shows Mount Etna erupting
on July 13th, 2001.</description>
<Icon>
<href>https://developers.google.com/kml/documentation/images/etna.jpg</href>
</Icon>
<LatLonBox>
<north>37.91904192681665</north>
<south>37.46543388598137</south>
<east>15.35832653742206</east>
<west>14.60128369746704</west>
<rotation>-0.1556640799496235</rotation>
</LatLonBox>
</GroundOverlay>
</Folder>
</kml>
another option would be to create a KMZ file that includes the image in the correct relative path.

What's the difference between Properties/DisplayName element and VisualElements#DisplayName attribute in .appxmanifest file

In following appxmanifest, what is the difference between
Package/Properties/DisplayName element
and
Package/Applications/Application/VisualElements#DisplayName
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Identity Name=""
Version=""
Publisher="" />
<Properties>
<DisplayName></DisplayName> <!-- this -->
<PublisherDisplayName></PublisherDisplayName>
<Logo></Logo>
</Properties>
<Prerequisites>
<OSMinVersion></OSMinVersion>
<OSMaxVersionTested></OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="" />
</Resources>
<Applications>
<Application Id="" StartPage="">
<!-- and this -->
<VisualElements DisplayName=""
Description=""
Logo="" SmallLogo=""
ForegroundText="" BackgroundColor="">
<SplashScreen Image="" />
</VisualElements>
</Application>
</Applications>
</Package>
https://msdn.microsoft.com/en-us/library/windows/apps/br211475.aspx
Package/Properties/DisplayName
The DisplayName is the name of your app that you reserve in the store, for apps which are uploaded to the store.
This is the actual reserved name in the developer portal (= store). When you package your app for upload to the store, this will be automatically set when going through the wizard in Visual Studio.
The root element Visual Elements is how the Windows Store app is visualized on the user's pc/phone.
Package/Applications/Application/VisualElements
Describes the visual aspects of the Windows Store app: its default tile, logo images, text and background colors, initial screen orientation, splash screen, and lock screen tile appearance.
So the DisplayName property under the Visual Elements element is how the app's name is shown on the user's pc. This can be different from the name in the store (e.g. localized).
A friendly name for the app that can be displayed to users. This string is localizable; see Remarks for details.
There are two explicitly reserved words that may not be used as the DisplayName for apps uploaded to the Windows Store: "NoUIEntryPoints" and "NoUIEntryPoints-DesignMode". These identifiers are reserved for use by development tools and test suites.
Source: https://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx
I have an app in the Store that may explain this issue.
Package/Properties/Display Name element refers to the app name in the Store which is the same as what's in Dashboard. While if you change the Display Name distribute in Visual Elements, your app will be different from itself in the Store after user installs it from the Store.

Trouble reading RSS data in AS3

I am trying to read a simple RSS feed in flash, but keep bumping into namespace issues. What's the proper way to get the content url from the following rss feed?
<rss version="2.0" xmlns:rbinl="http://reedbusiness.nl/rss/2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<item>
<media:content url="howtogetthis.jpg"/>
<title>This can be read from AS3</title>
</item>
</channel>
AS3 Code:
// this is working
xml.channel.item[0].title;
// this is not working
xml.channel.item[0].media.#url;
You need to reference the media namespace to access that content node with the url.
Here is an example:
//get a reference to the media namespace
var ns:Namespace = new Namespace("http://search.yahoo.com/mrss/");
//use ns::content to get a reference to a `content` node in the media namespace
xml.channel.item[0].ns::content.#url;
Keep in mind, namespaces prefix nodes. So the node name is content, not media.

How to check KML layer has active feed or not?

I created a KML layer for the URL - http://www.nhc.noaa.gov/gis/kml/nhc.kmz.
This layer is applied on the map and I could not see any layer. The reason is there is no active feed for this KML layer.
Is there any way to check if the KML layer has the active feed or not?
If a feed is not active (meaning the URL fails to load) Google Earth will show the NetworkLink icon with a red network link error icon. The status of network link fetching is shown with different icons as shown below:
Also note there are two validation errors in the KML, both in the target KML.
URL: http://www.nhc.noaa.gov/gis/kml/nhc_active.kml
1) The NetworkLinkControl expires time is formatted in a non-KML date format.
<NetworkLinkControl>
<minRefreshPeriod>120</minRefreshPeriod>
<expires>Thu, 28 Mar 2013 17:01:37 UTC</expires>
</NetworkLinkControl>
The kml:DateTime field is defined as the following:
<simpleType name="kml:dateTimeType">
<union memberTypes="dateTime date gYearMonth gYear"/>
</simpleType>
Recommend the ISO-8601 format: YYYY-MM-DD'T'HH:MM:SS'Z'
like this: 2013-03-28T17:01:37Z
References:
http://www.w3schools.com/schema/schema_dtypes_date.asp
http://www.w3.org/TR/xmlschema-2/#dateTime
2) The Document has a name defined twice. The second name appears it should be enclosed with a missing <Folder> element.
<Document id="active">
<name>Current Forecasts and Data</name>
...
<ScreenOverlay id="activeLegend">
</ScreenOverlay>
** following 3 tags don't belong here ***
<name>Active Tropical Cyclones</name>
<visibility>1</visibility>
<open>1</open>
</Document>
Recommend using a KML Validator to validate KML when it does NOT work like you expect it to.

how to toggle between KML files in Google Earth or toggle between sets of points

so basically I have a KML file that I load up, and I have 2 different sets of points that I present on there. However, I want to be able to present one set at a time, I figured the simplest way to do this is to split the set into 2 different KML files, and then load the appropriate file depending on set, or if there is another way of doing this, it could work for me as well.
Thanks a lot.
While kaliatech's answer is correct and useful, it is also a bit of overkill and harder to implement than this approach. It is a Google example and toggles the loading of various KML files via checkboxes.
All you need to do is change the filenames of your kmls to red/yellow/green OR change to code to names more specific to your use - depending on how comfortable you feel and what ythe end result you want is.
There are number of ways to do this if you are familiar with JavaScript and can make use of the Google Earth API.
This is an example of hiding/showing a folder within a KML file if the folder has a known ID:
var showFolder = true;
google.earth.fetchKml(gePlugin, kmlUrl, function(rootKmlFeature) {
if (rootKmlFeature) {
var myFolderEl = rootKmlFeature.getElementById('#myFolderId');
if (showFolder) {
myFolderEl.setVisibility(true);
}
else {
myFolderEl.setVisibility(false);
}
}
});
The root KmlFeature is always a KmlContainer which provides methods for looking up child elements. Note that it can be difficult to know whether or not you need to use "getElementById" or "getElementByUrl". The google documentation isn't particularly clear:
https://developers.google.com/earth/documentation/reference/interface_kml_container
Once you have a reference to the folder (or relevant KmlFeature), you can set the visibility (and many other properties) dynamically in response to UI events or whatever.
Edit (after your comment)
The fetchKml callback (in the HTML) provides you with the loaded kmlObject. Depending on how you want to trigger the show/hide interaction, you probably want to store that kmlObject in a higher (perhaps global) scope. Then, when user presses button, or whatever, you can do something like this:
function displayPlacemark1(visible) {
var baseUrl = 'https://sites.google.com/' + 'site/shahinkmlexamples/experiment/bombs12.kml';
var placemark = kmlObject.getElementByUrl('#placemark1');
placemark.setVisibility(visible);
}
Correspondingly, in your KML file, you want to add an id attribute to the placemarks. i.e.
...
<Placemark id="placemark1">
...
The solutions above describe the Google Earth API approach with JavaScript.
The pure-KML solution is to add a radio button via a ListStyle to a Folder in your KML then have each set of points in a sub-folder or NetworkLink link. You can make one of the sets visible by default by adding <visibility>0</visibility> element on the other sub-folders you want not shown initially. Another trick is having an empty first feature with instructions in the name or description to select radio button to view the other sets. You can find this used in the Google Maps Overlay in Google Earth.
radioFolder when specified for a Container, only one of the Container's items is visible at a time.
Here's example of KML using a radioFolder with two sets of Points:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Style id="rf">
<ListStyle>
<listItemType>radioFolder</listItemType>
</ListStyle>
</Style>
<Folder>
<name>Radio A visible by default</name>
<description>Select which folder to see</description>
<styleUrl>#rf</styleUrl>
<Folder>
<name>Folder A</name>
<Placemark>
<name>Radio A</name>
<Point>
<coordinates>-121.9921875, 37.44140625</coordinates>
</Point>
</Placemark>
</Folder>
<Folder>
<name>Folder B</name>
<visibility>0</visibility>
<Placemark>
<name>Radio B</name>
<visibility>0</visibility>
<Point>
<coordinates>-121.9921875, 37.265625</coordinates>
</Point>
</Placemark>
</Folder>
</Folder>
</Document>
</kml>
Reference:
https://developers.google.com/kml/documentation/kmlreference#listItemType